STRTRIM

Purpose:

Skips leading and/or trailing whitespace of a string.

Syntax:

STRCAT("str", mode, trimchars)

"str"

-

A string. The input string to process.

mode

-

Optional. An integer, the trim mode.

 

 

0:

trim trailing characters

1:

trim leading characters (default)

2:

trim both leading and trailing characters

"tricmchars"

-

Optional. A string, the characters to trim. Defaults to spaces, tabs and newlines.

Returns:

A string where the leading whitespace has been eliminated.

Example:

strtrim("   aaa bbb")

 

results in the string: "aaa bbb".

Example:

str1 = "   " + strescape("\t") + "text";

str2 = strtrim(str1)

 

str2 == "text"

Example:

strtrim("   aaa bbb    ", 0)

 

Returns the string "    aaa bbb".

Example:

strtrim("   aaa bbb    ", 2)

 

Returns the string "aaa bbb".

Example:

strtrim("xyzaaa bbbxyxy", 2, "xyz")

 

Returns the string "aaa bbb".

Remarks:

STRTRIM removes leading whitespace from a string, including spaces, strchar(32), tabs, strchar(9) and newlines strescape("\n").

See Also:

STRCHAR, STRCHARS

STRESCAPE

STREXTRACT

STRFIND

STRGET