notice the 2nd if is testing b.find which b = "$". Should this not find it?? since for a start "ID" isnt in the string and $ is only 1 char. Can anyone shread any light? And can someone maybe suggest another way of doing this?

No, it's very wrong. string::find() is a function.. I very much doubt that line is doing what you expect.

Also, "$" is not a char, it's a const char* - double quotes mean a null-terminated string, wheras '$' is a single char. Although it shouldn't affect the find() function, which takes parameters for both types.