Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Function

replace — replace one string for another

Synopsis

replace(s: string, old: string, new: string) -> string

Description

The replace function substitutes all instances of the string old that occur in string s with the string new.

Example


# spq
values replace(this, "oink", "moo")
# input
"oink oink oink"
# expected output
"moo moo moo"