TextTrim(text, leftOnly, rightOnly, trimChars)

Removes leading and trailing spaces from the text. When only one parameter is specified, leading and trailing space, tab, CR and LF characters are removed. When either optional «leftOnly» or «rightOnly» parameter is specified as True, the text is trimmed on one side only. You can also control which characters are trimmed using the optional «trimChars» parameter.


TextTrim(" Hello world ") → "Hello World"
TextTrim(" Hello world ", leftOnly: True) → "Hello world "
TextTrim(" Hello world ", rightOnly: True) → " Hello world"
TextTrim(" [One, Two, Three] ", trimChars:" []") → "One, Two, Three"

The one-parameter form of the function is equivalent to:

TextTrim(text, leftOnly: false, rightOnly: false, trimChars:" "&Chr(9)&Chr(10)&Chr(13))


This function is only available in Analytica 4.1 or later.

See also


You are not allowed to post comments.