substring

Returns a substring of 1 character beginning at the index specified by the argument passed in. An optional second argument specifies the length of the substring to be returned.

String indices are numbered starting from 0.

Input
  • {{ 'Hello' | substring: 2 }}  {{ 'Hello' | substring: 2, 3 }}  {{ 'Hello' | substring: -3, 2 }}
Output
  • l  llo  ll