Difference between revisions of "TextTrim"
Line 6: | Line 6: | ||
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. | 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. | ||
− | This function is only available in Analytica 4 | + | This function is only available in Analytica 4.1 or later. |
= Examples = | = Examples = |
Revision as of 00:31, 23 January 2008
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.
This function is only available in Analytica 4.1 or later.
Examples
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) )
See also
Comments
Enable comment auto-refresher