User`s manual

5-13
Here's a sample program using the INSTRING subroutine. (Type in the
above lines 999-1020 plus the following.)
5 CLEAR 1000 : CLS
10 INPUT "ENTER THE LONGER STRING";X$
20 INPUT "NOW ENTER THE SHORTER STRING";Y$
30 GOSUB 1000
40 IF I=0 THEN 70
50 PRINT Y$;" IS A SUBSTRING OF ";X$
55 PRINT "STARTING POSITION:";I,
60 PRINT "ENDING POSITION: ";I+LEN(Y$)-1
65 PRINT: PRINT: GOTO 10
70 PRINT Y$;" IS NOT CONTAINED IN ";X$
80 GOTO 10
RUN the program, entering the string to be searched and then the desired
substring.