This function replaces all substrings matching the given regular expression with a given replacement.
replaceAll(text, regexp, replacement) #Output: Text
If you want to replace only the first matching occurrence, have a look at the replaceFirst() function.
replaceFirst("Hello World", "l", "_") | replaceAll("Hello World", "l", "_") |
---|---|
"He_lo World" | "He__o World" |