5 The ``side`` argument was added in Twig 1.32.
7 .. versionadded:: 1.6.2
8 The ``trim`` filter was added in Twig 1.6.2.
10 The ``trim`` filter strips whitespace (or other characters) from the beginning
15 {{ ' I like Twig. '|trim }}
17 {# outputs 'I like Twig.' #}
19 {{ ' I like Twig.'|trim('.') }}
21 {# outputs ' I like Twig' #}
23 {{ ' I like Twig. '|trim(side='left') }}
25 {# outputs 'I like Twig. ' #}
27 {{ ' I like Twig. '|trim(' ', 'right') }}
29 {# outputs ' I like Twig.' #}
33 Internally, Twig uses the PHP `trim`_, `ltrim`_, and `rtrim`_ functions.
38 * ``character_mask``: The characters to strip
40 * ``side``: The default is to strip from the left and the right (`both`) sides, but `left`
41 and `right` will strip from either the left side or right side only
43 .. _`trim`: http://php.net/trim
44 .. _`ltrim`: http://php.net/ltrim
45 .. _`rtrim`: http://php.net/rtrim