#substring
Returns the part of a string that falls within the provided range.
#substring(value, range)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
value |
path | string |
The source string. |
range |
range |
A range such as 1..3, ..2 or ^2... |
Returns
Section titled “Returns”string
@text[range]is shorthand for#substring(@text, range). See indexing and slicing.
Examples
Section titled “Examples”Middle of a string
Section titled “Middle of a string”{ "text": "this is an example"}{ "result": "#substring($.text, 1..3)"}{ "result": "hi"}