AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
# `trim` New in version 1.6.2: The `trim` filter was added in Twig 1.6.2. The `trim` filter strips whitespace (or other characters) from the beginningand end of a string: <table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1 2 3 4 5 6 7</pre></div></td><td class="code"><div class="highlight"><pre>{{ ' I like Twig. '|trim }} {# outputs 'I like Twig.' #} {{ ' I like Twig.'|trim('.') }} {# outputs ' I like Twig' #} </pre></div></td></tr></table> Note Internally, Twig uses the PHP [trim](http://php.net/trim) [http://php.net/trim] function. ### Arguments - `character_mask`: The characters to strip