strip spaces from string using smarty

vandu picture vandu · Sep 7, 2012 · Viewed 17.7k times · Source

I am new to smarty.

I want to know how to remove all white-space characters from a given string in Smarty?

I have a string like "this is my string". The output should be "thisismystring".

How can I do this?

Answer

mishmash picture mishmash · Sep 12, 2012

From the documentation:

{$YourVariable|replace:' ':''}