String Replace All
Returns a new string with all matches of a substr replaced by newSubStr
Description
Replaces the part 'substr' of the string 's' with the new string 'newSubstr'.
E.g:
The string (s) is "ABCDEF"
Part of the string to be replaced (substr) is "CD"
The new string to be replaced into (newSubstr) is "12"
The result will be "AB12DEF"
Inputs
- s (String): The string in which to do the replacement
- substr (String): The string that is to be replaced by 'newSubstr'. It is treated as a literal string and is not interpreted as a regular expression.
- newSubstr (String): The string that replaces the substring specified in the 'subStr'
Outputs
- s.replaceAll(substr, newSubStr) (String): The newly created string