INSTR
pos = INSTR ([start,] s1, s2)
Returns the position pos
of the first occurrence of the
string s2
in string s1
(starting from the
position start
). If there is no match, INSTR returns 0.
Example 1: Get position starting a the beginning of the string
"abcdef"
s1 = "cd"
s2 = print instr(s1, s2) ' Output 3
Example 2: Get position using a starting point
"abcdefabcd"
s1 = "ab"
s2 = print instr(3, s1, s2) ' Output: 7 (instead of 1)
Code samples using INSTR
biorythms.bas
blackjack.bas
BlackJack.bas
bolmo.bas
bulls and cows.bas
calc.bas
dia de una fecha.bas
dmsareareadmd.bas
dogstar5.bas
filemanager.bas
g2 Life.bas
g3 Life.bas
g4 Life.bas
g5 Life.bas
g6 Life.bas
hangman v2.bas
hangman.bas
irc-bot.bas
lander.bas
lib-gputmcon.bas
Mandala life.bas
mandala life.bas
mandelbrot explorer.bas
mastermind.bas
memory match game.bas
memoryTest.bas
memorytest.bas
new bas.bas
new help.bas
String
ASC
BCS
BIN
CBS
CHOP
CHR
DISCLOSE
ENCLOSE
FORMAT
HEX
INSTR
JOIN
LCASE
LEFT
LEFTOF
LEFTOFLAST
LOWER
LTRIM
MID
OCT
REPLACE
RIGHT
RIGHTOF
RIGHTOFLAST
RINSTR
RTRIM
SINPUT
SPACE
SPC
SPLIT
SPRINT
SQUEEZE
STR
STRING
TRANSLATE
TRIM
UCASE
UPPER
VAL
If there is insufficient information on this page and you wish learn more about INSTR,
please send an email to smallbasic@gmail.com. You can help to improve information about
INSTR by submitting a pull request,
click View Source for details. Note, an offline language reference text file is also available - see the Download section.