str-replace

native

(str-replace s from to)

(str-replace s from to) — return s with every occurrence of from replaced by to, scanning left to right without overlaps; an absent from returns s unchanged. The search string must not be empty — (str-replace "a" "" "x") is a typed rejection — while an empty to deletes occurrences. Example: (str-replace "hello world" "o" "0") => "hell0 w0rld". A non-string argument is a typed rejection.