instr$

Syntax

position = INSTR$(begin, text, search_key)

Arguments

text, search_key: text

position, begin: integer

Meaning

Searches case-sensitive for character string search_key in text text starting at position begin. Returns the start position if search_key is found, otherwise 0.

Example 1

position = INSTR$(4, 'abcdefghij', 'ghi')

Result

position is 7.

Example 2

position = INSTR$(10, 'abcdefghijklm', 'ghi')

Result

position is 0.

Example 3

position = INSTR$(1, 'abcde\fghijklm', '\')

Result

position is 6 (no need to escape the backslash here).

See also

RINSTR$

Regvalidate