Skip to main content

LTrim, RTrim, and Trim

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

FeedbackOpens in a new tab