Skip to content

replaceAll

replaceAll(pattern, replacement): (s) => string

Defined in: Data/Str.ts:68

Replaces all occurrences of a pattern in a string. Data-last: use in pipe.

string | RegExp

string

(s) => string

pipe("foo foo foo", Str.replaceAll("foo", "bar")); // "bar bar bar"
pipe("aAbBaA", Str.replaceAll(/a/gi, "x")); // "xxBBxx"