slice
The slice
filter returns a portion of a list, array, or string.
{{ ['apple', 'peach', 'pear', 'banana'] | slice(1,3) }}
{# results in: [peach, pear] #}
{{ 'Mitchell' | slice(1,3) }}
{# results in: 'it' #}
Arguments
fromIndex
: 0-based and inclusivetoIndex
: 0-based and exclusive