Skip to content

#replace

Returns the string with all occurrences of a substring replaced with another value.

#replace(value, oldValue, newValue)
Category StringsValid in Property value
Name Type Description
value path | string The string to search.
oldValue string The substring to replace.
newValue string The replacement.

string

source.json
{
"text": "a-b-c"
}
transformer.json
{
"result": "#replace($.text, '-', '/')"
}
output.json
{
"result": "a/b/c"
}

Try it in the playground →

#regexReplace