dcsimg

Why doesn't the String.replace() actually replace anything?

John Zukowski

In Java, Strings are immutable. Since the string cannot be modified in place, the replace() method returns a new String constructed from a modified copy of the original String's value.