Skip to main content

This version of the product is no longer supported, and this documentation is no longer updated regularly. See the latest version of this content.Opens in a new tab

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