strip - pfaciana/latte-js GitHub Wiki

Replaces all spaces, newlines and tabs with a single space, or with the supplied string.


Note:- If you want to strip blocks of template text, use the built-in {strip} function.


Parameter Position Type Required Default Description
1 string No one space This value is replace when srtiping space, new line and tabs.

Template:

{$articleTitle = "Grandmother of\neight makes\t    hole in one."}

{$articleTitle}

{$articleTitle|strip}

{$articleTitle|strip:' '}

output:

Grandmother of
eight makes        hole in one.

Grandmother of eight makes hole in one.

Grandmother of eight makes hole in one.

see also strip in PHP Smarty documentation.

⚠️ **GitHub.com Fallback** ⚠️