PHP Classes

File: libs/Twig/doc/filters/trim.rst

Recommend this page to a friend!
  Classes of william amed   Raptor 2   libs/Twig/doc/filters/trim.rst   Download  
File: libs/Twig/doc/filters/trim.rst
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Raptor 2
Framework that takes routes from annotations
Author: By
Last change:
Date: 8 years ago
Size: 519 bytes
 

Contents

Class file image Download
``trim`` ======== .. versionadded:: 1.6.2 The trim filter was added in Twig 1.6.2. The ``trim`` filter strips whitespace (or other characters) from the beginning and end of a string: .. code-block:: jinja {{ ' I like Twig. '|trim }} {# outputs 'I like Twig.' #} {{ ' I like Twig.'|trim('.') }} {# outputs ' I like Twig' #} .. note:: Internally, Twig uses the PHP `trim`_ function. Arguments --------- * ``character_mask``: The characters to strip .. _`trim`: http://php.net/trim