Previous Topic: Str - Convert Numeric Expression to StringNext Topic: UCase - Convert Lowercase Letter to Uppercase


Trim - Remove Leading and Trailing Spaces from a String

Valid on NetWare, Symbian OS, UNIX, Windows and Windows CE

The Trim function removes leading and trailing spaces from the string.

Function format:

Trim(str as String) as String
str

Identifies the string that is to be trimmed.

The function returns the trimmed string.

Example:

Dim tStr, str As String

str = "  abcd "
tStr = Trim(str)
Print(">>>"+Str+"<<<")
Print(">>>"+tStr+"<<<")

This prints:
>>>  abcd <<<
>>>abcd<<<