replace

String
since 4.0.0

Returns

string the modified string.

Replaces matches for pattern in string with replacement.

Note: This method is based on String#replace.

Example of Lodash _.replace

_.replace('Hi Fred', 'Fred', 'Barney');
// => 'Hi Barney'