slice
Returns a substring or series of array items starting from a given 0-based index.
Parameters
str{String}The input string, required.index{Number}The starting index, required.[length]{Number}The length of the substring, optional, defaults to 1.returns{String}The resulting substring.
Usage
{{slice str index [length]}}
Example
{{ slice 'hello' 1 }}
{{ slice 'hello' 0 }}
{{ slice 'hello' 1 3 }}
{{ slice 'hello' -3 2 }}
Was this article helpful to you?