Skip to content

#indexOf

Returns the zero-based index of the first occurrence of the provided value.

#indexOf(value, search)
Category Strings and arraysValid in Property value
Name Type Description
value path | string | array The string or array to search.
search any The value to find.

integer

source.json
{
"text": "hello"
}
transformer.json
{
"result": "#indexOf($.text, 'l')"
}
output.json
{
"result": 2
}

Try it in the playground →

#contains