slice
Filter
Slices a string by an offset and length.
Parameters
Parameter | Required | Description |
---|---|---|
offset
|
Yes |
integer Starting index within the string to slice. (The first character is at
position 0 .) Pass a negative value to start at the end of the string. (The last
character is at position -1 .)
|
length
|
No |
integer Length of string to slice. If no value is provided, this defaults to
1 .
|
Category
Description
The slice
filter allows you to slice a substring out of a string by an offset index
and length.
When passing a negative value for the offset index, the slice
filter will start at the
last character and count backwards.