Replaces all occurrences of a pattern within a string with another pattern.
Syntax
public static String stringReplace(String src, String oldpattern, String newPattern)
Parameters
Return values
A new string with the new pattern.
Notes
The method replaces all occurrences of the value specified by oldPattern with the value specified by newPattern. For single character replacement, use the replace() in the Java String class. If oldPattern is not found, the original, unmodified string is returned.
Examples
The following results in youoyou and dad.
stringReplace("momomom and dad", "mom", "you");