David...
If you 'always' rx've an unknown char, can you not offset your search by one char and start looking after it
or
Search within the rx'ed string for your target string, if its not there it would return -1, if there it would return the starting position of your target string.
or
Check that in your string you are sending to you TCP server that you are not sending somethng you shouldn't. Are you creating the string at string[1] and forgetting string [0]. Or have you got some '\' within your string that are being interpretted as a control code and treat the next character wrongly?
Just a few things off the top of my head.
Regards
Chris