strip
string | strip
returns string
Strips all whitespace from the left and right of a string.
{%- assign text = ' Some potions create whitespace. ' -%}
"{{ text }}"
"{{ text | strip }}"
{%- assign text = ' Some potions create whitespace. ' -%}
"{{ text }}"
"{{ text | strip }}"
Output
" Some potions create whitespace. "
"Some potions create whitespace."
Was this page helpful?