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.
LEFT$, RIGHT$ Functions
  Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
Return a specified number of leftmost or rightmost characters in a string.
 
LEFT$(stringexpression$,n%)
RIGHT$(stringexpression$,n%)
 
    ■ stringexpression$    Any string expression.
    ■ n%                   The number of characters to return, beginning
                           with the leftmost or rightmost string character.
 
Example:
    a$ = "Microsoft QBasic"
    PRINT LEFT$(a$, 5)     'Output is:  Micro
    PRINT RIGHT$(a$, 5)    'Output is:  Basic
 
See Also    MID$