Ah, some broken C code is putting NUL terminators into the database! Go whack somebody on the head.
Joined: Aug 05, 2002
using jakarta-commons-lang, you could also StringUtils.chop(string) to remove the last character (no matter what it is)
Joined: Jul 11, 2001
Originally posted by Sanju Thomas: I did it.
String str = resultSet.getString(1)
str = str.replace((char)0,(char)13);
That doesn't remove the null character, but does replace it with the character of unicode 13.
To really just remove it, use
str = str.replaceAll("\\u00", "");
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus