Skip to main content
Version: v1.10.0

replace

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:

echo '"oink oink oink"' | zq -z 'yield replace(this, "oink", "moo")' -

=>

"moo moo moo"