Home > Language Reference > String Management Functions > Trim$

Trim$

The Trim$ function removes leading spaces/tabulations from the specified string.

Usage

Used to get rid of non displayable characters when you want to compare with another string. 

Syntax

var$=Trim$(<source_string>)

Parameters

<source_string>, string to remove leading and trailing spaces/tabulations from.

Return value

var$, string with the leading and trailing spaces/tabulations removed.

See also

Asc
Chr$
Encrypt
ExtractBetween$
InStr
InStrRev
LCase$
Left$
Len
LTrim$
Mid$
Replace$
Right$
RTrim$
SplitIntoArray
Str$
UCase$
Val

Examples

a$ = Trim$(" bcde ") ' Returns "bcde" in a$

a$ = Trim$(a$) ' Deletes the spaces at the beginning and at the end of a$