Awee

trim

Trim removes leading and trailing whitespace, or the given character set.

Trim removes leading and trailing whitespace, or the given character set.

Input

string bytes

Parameters

#TypeRequired
0stringno

Returns

string, bytes

Examples

Clean whitespace from a name

Input

name = "  Alice  "

Template

{{ name | trim }}

Output

Alice

Strip a wrapping character

Input

list = ",apples,bananas,"

Template

{{ list | trim:',' }}

Output

apples,bananas

How is this guide?

On this page