string replace method matches the string with specified string or regular expression pattern and replace the matches with new string finally returns the replaced string.
Note:
-
replace method performs case sensitive matches.
-
When matching with string it replaces first match on the data by new string.
-
When matching with pattern can possible to replace all matches in a string.