replace
_.replace(pattern, replacement, string)
# Ⓢ [Ⓣ][1] Ⓝ
Replaces matches for pattern in string with replacement.
Note: This method is based on
Since
4.0.0
Arguments
pattern(RegExp|string): The pattern to replace.replacement(Function|string): The match replacement.string(string): The string to modify.
Returns
(string): Returns the modified string.
Example
_.replace('Fred', 'Barney', 'Hi Fred');
// => 'Hi Barney'