The input string.
The substring to be replaced.
The replacement string.
Optional. The flags for the regular expression. Defaults to 'g'.
const input = 'Hello, world!';
const replace = 'o';
const replaceWith = '0';
strReplaceAll(input, replace, replaceWith);
//=> 'Hell0, w0rld!'
Generated using TypeDoc
Replaces all occurrences of a substring in a string with a specified replacement.