Java String Replace and null characters
- by praspa
Testing out someone elses code (of course it was ...) ,
I noticed a few JSP pages printing funky non-ascii characters. Taking a dip into the source I found this tidbit.
// remove any periods from first name e.g. Mr. John --> Mr John
firstName = firstName.trim().replace('.','\0');
Does replacing a character in a String with a null character even work in Java? I know that '\0' will terminate a c-string. Would this be the culprit to the funky characters?
Thanks
PR