Specifications

Commands - 59
INSTR
Function
SYNTAX: a = INSTR(n,string,substring)
PURPOSE: Returns the position of the first occurrence on a substring within a string.
REMARKS: The parameter n specifies where the search is to start in the string. A “1” signifies the leftmost
position in the string. This parameter is not optional.
string is a string constant or string variable that is to be searched.
substring is the string variable or constant to be searched for.
If n is greater than the length of string or if string is null or if substring cannot be found, INSTR
returns zero. If substring is null, INSTR returns n or one.
RELATED: LEFT$, RIGHT$, LEN and MID$
EXAMPLE: 10 A$="BOOHOO"
20 B$="HOO"
30 PRINT INSTR(1,A$,B$)
RUN
4
ERROR: <Illegal argument> – if n < 1