Trim

Trims characters from the beginning and/or end of a string.

Result :=  Trim(String , OmitChars := " `t")
Result := LTrim(String , OmitChars := " `t")
Result := RTrim(String , OmitChars := " `t")

Parameters

String

Type: String

Any string value or variable. Numbers are not supported.

OmitChars

Type: String

An optional list of characters (case sensitive) to exclude from the beginning and/or end of String. If omitted, spaces and tabs will be removed.

Return Value

Type: String

These functions return the trimmed version of the specified string.

Examples

#1

text := "  text  "
MsgBox
(
    "No trim:`t'" text "'
    Trim:`t'" Trim(text) "'
    LTrim:`t'" LTrim(text) "'
    RTrim:`t'" RTrim(text) "'"
)
MsgBox LTrim("00000123", "0")