-- More than often we need to manipulate a string, substitute characters inside a string. In Java, the String class, there are a couple of methods that we can use to complete this task. 1. public String replace(char oldChar, char newChar) This method "returns a new string resulting from replacing all occurrences of oldChar in this string with newChar." Both oldChar and newChar are single char. For example, String a = "This is a cat."; String b = a.replace('c', 'r'); b has the value of "This is a rat.". 2. public String replace(CharSequence target, CharSequence replacement)
About Java and it's related concepts..