replace()
Replace targeted substrings with new strings.
This function is valid in v2.0.0 to v2.24.3. This function has been downloaded 61 times.subject
and replaced by the result of replacer
. If this is an array each of the contents will be searched for within subject
and replaced by the result of replacer
. If this is an object each key will be searched for and replaced by the result of the corresponding value. If the corresponding value of an object's property is a function it will be executed the same way replacer
would be.target
found with argument 1 being the match array (including match.input
, match.index
, and match.source
), argument 2 being the iteration count and argument 3 being a function that when executed will immediately stop replacing values. If a string is supplied it will replace all instances of target
within subject
. This parameter can be omitted and will be ignored if target
is an object.subject
with all of the targeted substrings replaced with new strings as specified either by target
or replacer
.This function directly requires the following functions which are included automatically:
matchAll()
quoteRegExp()
typeOf()