{% set strstr=val|slice(#0,strpos#) %}
{{strstr}}
{# output = 'abc' #}
{% set strrstr=val|slice(#strpos,val|length#) %}
{{strrstr}}
{# output = 'tiaxgamedefghtiaxgamexyz' #}
{% set strrchr=needle~val|split(#needle#)|last %}
{{strrchr}}
{# output = 'tiaxgamexyz' #}
Còn stripos, strripos, stristr, strristr là KHÔNG phân biệt chữ hoa, thường: thì ta chỷ cần "lọc" 'val' và 'needle' về 1 loại toàn hoa hay thường là ok,