Skip to content

#startsWith

Returns true if a string starts with the provided substring, false otherwise.

#startsWith(value, prefix)
Category StringsValid in Property value
Name Type Description
value path | string The string to test.
prefix string The expected prefix.

boolean

source.json
{
"id": "ORD-123"
}
transformer.json
{
"result": "#startsWith($.id, 'ORD-')"
}
output.json
{
"result": true
}

Try it in the playground →

#endsWith