INSTR()

Compatible with:
DOS Maximite CMM MM150 MM170 MM+ MMX Picromite ArmiteL4 Armite F4 ArmiteH7 Picomite CMM2

Syntax:
INSTR( [start-position,] stringsearched$, string-pattern$ )

Description:
Returns the position at which 'string-pattern$' occurs in 'string-searched$', beginning at 'start-position'. 
Both the position returned and 'start-position' use 1 for the first character, 2 for the second, etc. The function returns zero if 'string-pattern$' is not found.

The comparison is Case sensitive. "Max" doe NOT equal "max"

PRINT INSTR("Colour Maximite","Max")
PRINT INSTR("Colour Maximite","max")

Output:
8
0


MMBasic Regex Syntax used in INSTR and LINSTR functions.

The alternate forms of the INSTR() and LINSTR() functions can take a regular expression as the search pattern in the Picomites and some other platforms.

See regex.htm for details

 

Last edited: 04 October, 2023