Skip to content

#substring

Returns the part of a string that falls within the provided range.

#substring(value, range)
Category StringsValid in Property value
Name Type Description
value path | string The source string.
range range A range such as 1..3, ..2 or ^2...

string

source.json
{
"text": "this is an example"
}
transformer.json
{
"result": "#substring($.text, 1..3)"
}
output.json
{
"result": "hi"
}

Try it in the playground →

#slice