Caché Basic Reference
LTrim, RTrim, and Trim
[Home] [Back] [Next]
InterSystems: The power behind what matters   
Class Reference   
Search:    

Returns a copy of a string without leading spaces (LTrim), trailing spaces (RTrim), or both leading and trailing spaces (Trim).
Synopsis
LTrim(string)

RTrim(string)

Trim(string)
Arguments
The string argument is any valid string expression.
Examples
The following example uses the LTrim, RTrim, and Trim functions to trim leading spaces, trailing spaces, and both leading and trailing spaces, respectively:
Dim MyVar
MyVar = LTrim("  Caché ")  'MyVar contains "Caché ".
Println Len(MyVar),":",MyVar,":"
MyVar = RTrim("  Caché ")  'MyVar contains "  Caché".
Println Len(MyVar),":",MyVar,":"
MyVar = Trim("  Caché ")   'MyVar contains "Caché".
Println Len(MyVar),":",MyVar,":"
 
See Also