Strip space from a string using smarty

I am new to the skill.

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

I have a line like "this is my line". The result should be "itismystring".

How can i do this?

+5
source share
3 answers

From the documentation :

{$YourVariable|replace:' ':''}
+17
source

anything between the strip, all spaces will be removed.

 {strip}{/strip}
+3
source

You can remove the space from a variable (string) using a modifierstrip

{$myVar|strip}
0
source

All Articles