Trim$

String management function.

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

Usage

Used to take spaces off the beginning and the end of a text. To avoid spaces added by mistake during data-entry, use this function.

Syntax

var$=Trim$(<string$>)

Parameters

<string$>, string to be trimmed.

Return value

var$, string, return value containing the trimmed string.

See also

Ltrim$

Rtrim$

Examples

 

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

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