replace(s: utf8, old: utf8, new: utf8) → utf8
Category: [strings](builtinsstrings)_
Replace every occurrence of a substring with another.
| Parameter | Type | Description | Remarks |
|---|---|---|---|
| s | utf8 | The string to search. | — |
| old | utf8 | The substring to find. | — |
| new | utf8 | The replacement substring. | — |
| returns | utf8 | The string with every match replaced. | — |
wcl
replace("hello world", "world", "there") // replace the matched substring → "hello there"