Don't use String class which behaves funny, instead use old plain char arrays.