Trim Function

The Trim function removes and leading or trailing spaces in a string. A good use case is using Trim on any malformed data that may have been imported or inserted in a data extension with leading spaces. For example, if you are using a free form text field where the data is captured in a data extension, users who enter in information may inadvertently add spaces within the form.

Example:

					

%%[
set @response = Trim([Input])
]%%
This is your response: %%=v(@response)=%%,

Data Extension:

EmailAddressInput
test@test.com‘ Hello. ‘

Output:

This is your response: Hello.

Explanation:

The Trim function removes any leading spaces and his is helpful if your data is not formatted correctly in the data extension.

Leave a Reply

Your email address will not be published. Required fields are marked *