The fact that the replace method returns a string object rather than replacing the contents of a given string is a little obtuse (but understandable when you know that strin
All string manipulation in general are very slow. Consider to use StringBuffer, it's not exactly like the String class, but have a lot in common and it's mutable as well.