Explanation
INSTR Function
Returns the position of the first occurrence of a string in another string.Worth knowing
Useful and cross-version information about the programming environments of QBasic, QuickBasic and Visual Basic for DOS.
Useful and cross-version information about the programming environments of QBasic, QuickBasic and Visual Basic for DOS.
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. |
a$ = "Microsoft QBasic"
PRINT "String position ="; INSTR(1, a$, "QBasic")
See also: | LEFT$, RIGHT$ | LEN | MID$ |