Guess his problem is more about how to identify the length of the string.
Try looking at your string in memory and how his length is determined.
As far as it isnt something exotic it should be 00 terminated or the length is infront of the characters.