TRIM$ function

Purpose:

TRIM$ removes the following characters from the leading and trailing parts of a string.

Syntax:

RetStr = TRIM$(MainStr AS STRING)

Return Value:

  • Data type: STRING
    RetStr The trimmed substring of MainStr.

Parameters:

  • Data type: STRING
    MainStr String from which leading and trailing
    • ASCII code point 9 CHARACTER TABULATION
    • ASCII code point 10 LINE FEED
    • ASCII code point 11 LINE TABULATION
    • ASCII code point 12 FORM FEED
    • ASCII code point 13 CARRIAGE RETURN
    • ASCII code point 32 SPACE
    characters are to be removed.

Example:

DIM RetStr$

RetStr$ = TRIM$("     ABCDEFG     ")

PRINT RetStr$

Result:

ABCDEFG