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.
INSTR Function
  Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
Returns the position of the first occurrence of a string in another string.
 
INSTR([start%,]stringexpression1$,stringexpression2$)
 
    ■ start%                Sets the character position where the search
                            begins. If start% is omitted, INSTR starts at
                            position 1.
    ■ stringexpression1$    The string to search.
    ■ stringexpression2$    The string to look for.
 
Example:
    a$ = "Microsoft QBasic"
    PRINT "String position ="; INSTR(1, a$, "QBasic")
 
See Also    LEFT$, RIGHT$    LEN    MID$