A string or regular expression to search for.
A string containing the text to replace. When the searchValue is a RegExp
, all matches are replaced if the g
flag is set (or only those matches at the beginning, if the y
flag is also present). Otherwise, only the first match of searchValue is replaced.
Replaces text in a string, using a regular expression or search string.
A string to search for.
A function that returns the replacement text.
Rest
...args: any[]Passes a string and replaceValue to the [Symbol.replace]
method on searchValue. This method is expected to implement its own replacement algorithm.
An object that supports searching for and replacing matches within a string.
The replacement text.
Replaces text in a string, using an object that supports replacement within a string.
A object can search for and replace matches within a string.
A function that returns the replacement text.
Rest
...args: any[]
Replaces text in a string, using a regular expression or search string.