format.trim ViewHelper <f:format.trim>

This ViewHelper strips whitespace (or other characters) from the beginning and end of a string.

Possible sides are:

both (default)
Strip whitespace (or other characters) from the beginning and end of a string
left or start
Strip whitespace (or other characters) from the beginning of a string
right or end
Strip whitespace (or other characters) from the end of a string

Examples

Defaults

#<f:format.trim>   String to be trimmed.   </f:format.trim>#
Copied!
#String to be trimmed.#
Copied!

Trim only one side

#<f:format.trim side="right">   String to be trimmed.   </f:format.trim>#
Copied!
#   String to be trimmed.#
Copied!

Trim special characters

#<f:format.trim characters=" St.">   String to be trimmed.   </f:format.trim>#
Copied!
#ring to be trimmed#
Copied!

Arguments

value

DataType
string
Required
false
Description
The string value to be trimmed. If not given, the evaluated child nodes will be used.

characters

DataType
string
Required
false
Description
Optionally, the stripped characters can also be specified using the characters parameter. Simply list all characters that you want to be stripped. With .. you can specify a range of characters.

side

DataType
string
Default
'both'
Required
false
Description
The side to apply, must be one of this' CASE_* constants. Defaults to both application.