#contains
Returns true when an array or string contains the provided value.
#contains(value, search)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
value |
path | string | array |
The string or array to search. |
search |
any |
The value to find. |
Returns
Section titled “Returns”boolean
Examples
Section titled “Examples”Substring and element
Section titled “Substring and element”{ "text": "hello world", "tags": [ "a", "b" ]}{ "inText": "#contains($.text, 'world')", "inTags": "#contains($.tags, 'c')"}{ "inText": true, "inTags": false}