GLBasic User Manual

Main sections

TRIM$()

res$ = TRIM$(text$, trim$=" \t\r\n\v\f")



Cuts all characters within trim$ off from the beginning and the back end of text$.
This command is a substitute for LTRIM$(RTRIM$(text$, trim$), trim$).

LOCAL tr$[]
DIMDATA tr$[], " \t 123 45\f ", " 2 2 2", "2 2 2 ", " ", ""

FOREACH t$ IN tr$[]
    STDOUT "L:>"+LTRIM$(t$)+"< R:>"+RTRIM$(t$)+"< T:>"+TRIM$(t$)+"<\n"
NEXT

KEYWAIT
END

See also...