trim

Function trim 

Source
pub fn trim(s: Cow<'_, str>, chars: Option<Cow<'_, str>>) -> String
Expand description

Trims a string.

By default, it trims leading and trailing whitespaces:

{{ "  non-space characters  " | trim }} -> "non-space characters"

You can also remove a character sequence. All the prefixes and suffixes matching the sequence are removed:

{{ "1212foo12bar1212" | trim("12") }} -> "foo12bar"