Skip to content

@str.replace

Replace all occurrences of a substring.

Returns: string

@str.replace(s old replacement)
Name Type Description
s string Source string
old string Substring to match
replacement string Replacement text
# Replace all occurrences
set $s @str.replace("foo-bar-baz" "-" "_")
# Remove a substring
set $s @str.replace("hello world" " world" "")