]> git.immae.eu Git - github/wallabag/wallabag.git/blame - vendor/twig/twig/doc/filters/trim.rst
gitignore vendor
[github/wallabag/wallabag.git] / vendor / twig / twig / doc / filters / trim.rst
CommitLineData
4f5b44bd
NL
1``trim``
2========
3
4.. versionadded:: 1.6.2
5 The trim filter was added in Twig 1.6.2.
6
7The ``trim`` filter strips whitespace (or other characters) from the beginning
8and end of a string:
9
10.. code-block:: jinja
11
12 {{ ' I like Twig. '|trim }}
13
14 {# outputs 'I like Twig.' #}
15
16 {{ ' I like Twig.'|trim('.') }}
17
18 {# outputs ' I like Twig' #}
19
20.. note::
21
22 Internally, Twig uses the PHP `trim`_ function.
23
24Arguments
25---------
26
27 * ``character_mask``: The characters to strip
28
29.. _`trim`: http://php.net/trim