Replaces matches for pattern in string with replacement.
pattern
string
replacement
Note: This method is based on String#replace.
String#replace
Returns the modified string.
5.8.0
[[truncate]], [[trim]]
replace('Hi Fred', 'Fred', 'Barney')// => 'Hi Barney' Copy
replace('Hi Fred', 'Fred', 'Barney')// => 'Hi Barney'
Replaces matches for
pattern
instring
withreplacement
.Note: This method is based on
String#replace
.