Replace
Last updated
Was this helpful?
Last updated
Was this helpful?
The replace
method allows us to replace a character, word, or sentence with a string. For example.
To replace a value on all instances of a with a g
modifier is set.
It searches for a string for a value or a regular expression and returns a new string with the value(s) replaced. It doesn't change the original string. Let's see the global case-insensitive replacement example.