Replace Characters in a String

To replace a character in a string with another character you need to call the method replace() with the two characters as arguments.
The first argument is the character to be replaced and the second is the character that will be inserted.

When the code above is executed it will display:

Search for more Java info on this site here:
Custom Search

Please type any questions here.