qbasic.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
LTRIM$, RTRIM$ Functions
  Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
Remove leading and trailing spaces from a string.
 
LTRIM$(stringexpression$)
RTRIM$(stringexpression$)
 
    ■ stringexpression$    Any string expression.
 
Example:
    a$ = "    Basic    "
    PRINT "*" + a$ + "*"            'Output is:  *    Basic    *
    PRINT "*" + LTRIM$(a$) + "*"    'Output is:  *Basic    *
    PRINT "*" + RTRIM$(a$) + "*"    'Output is:  *    Basic*