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?
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?
From the documentation:
{$YourVariable|replace:' ':''}
anything between strip, all spaces will be removed.
{strip}{/strip}
You can strip whitespace from a variable (string) by using the strip
modifier, and passing an empty string to it as an argument:
{$myVar|strip:""}
© 2022 - 2025 — McMap. All rights reserved.
{$variable|replace:' ':''}
. – Bridgid