Trim

This function removes the leading and trailing spaces from the specified string.

Argument

Trim(1)

Ordinal Type Required Description
1 String True String value to trim

Example 1

%%[

var @firstName
var @firstNameTrimmed

set @firstName = AttributeValue("FirstName") /* value from attribute or DE column in send context */
set @firstName = "  Dale   " /* or a literal value */
set @firstNameTrimmed = trim(@firstName)

]%%
Hello, %%=v(@firstName)=%%!
<br><br>Hello, %%=v(@firstNameTrimmed)=%%!

Output

Hello, Dale !

Hello, Dale!