Skip to content

replaceAll

replaceAll(target, search, replace)

Replaces all occurrences of search string or regular expression in target string with replace string.

ts
replaceAll("hello world world", "world", "universe"); // "hello universe universe"
replaceAll("hello world", /o/g, "0"); // "hell0 w0rld"
ts
pipe("hello world world", replaceAll("world", "universe")); // "hello universe universe"
pipe("hello world", replaceAll(/o/g, "0")); // "hell0 w0rld"