ez.no / exponential / documentation / reference / template operators / strings / extract
$input_string|extract( offset [, length] )
| Name | Type | Description | Required |
|---|---|---|---|
| offset | integer | Start position of extraction. | yes |
| length | integer | Length of extraction (default: unlimited). | no |
string containing portion of input string.
The extract operator will return a portion of an inputted string or array. The returned portion is defined by the offset and length parameters. If length is omitted, the rest of the array/string (from offset) will be returned.
{"I love monday mornings!"|extract( 6 )}
returns the string "monday mornings!".
{"Big apples."|extract( 4, 5 )}
returns the string "apple".
Comments