Introduction

The trim filter is used to remove whitespace (or other specified characters) from the beginning and end of a string. It is useful for cleaning input data or ensuring that strings are processed without unwanted spaces.

Example of use

Example of how to use the trim filter to remove whitespace from a string:

{% set text = '   Reportana   ' %}
{{ text|trim }}

Example Output Code