It removes leading and trailing spaces from the text. Via options, you can also trim only the beginning or the end of the text or specify the characters to remove (by default, PhraseExpander removes blanks and newlines).
This function can be useful, for example, to remove spaces (or special characters) from the text generated by variables.
Syntax
{#trim text -[pos][chars]#}
text: text to trim
[pos]: define which part of the text will be trimmed:
all (default) - Trims both the beginning and the end of the text
start - Trims characters only from the beginning of the text
end - Trims characters only from the end of the text
[char]: the characters to remove (if empty, blanks are removed). The special placeholders #NL# and #TAB# are used to remove new lines and TABS respectively. PhraseExpander will remove all the specified characters.
Example
Template:
{#trim Mark #}
Result:
Mark
Template:
{#trim A,B,C, -[char=,][pos=end]#}
Result:
A,B,C
Removes the , character from the end of the text