Awee

trim-prefix

TrimPrefix removes a leading prefix string or leading whitespace from the value.

TrimPrefix removes a leading prefix string or leading whitespace from the value.

Input

string bytes

Parameters

#TypeRequired
0stringno

Returns

string, bytes

Examples

Drop a leading slash from a path

Input

path = "/api/v1/users"

Template

{{ path | trim-prefix:'/' }}

Output

api/v1/users

Trim leading whitespace from a paragraph

Input

text = "   Welcome aboard."

Template

{{ text | trim-prefix }}

Output

Welcome aboard.

How is this guide?

On this page