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