en:instr [BASIC 256 - Language Documentation]

# BASIC 256 - Language Documentation

en:instr

## Instr (Function)

### Format

instr ( haystack_expr , needle_expr )
instr ( haystack_expr , needle_expr , start_expr )
instr ( haystack_expr , needle_expr , start_expr , boolean_expr)

returns positive_integer_value

### Description

Check to see if the string needle_expr is contained in the string haystack_expr. If it is, then this function will return the index of starting character of the first place where needle_expr occurs. Otherwise, this function will return 0. You may also specify an optional starting location for the search to begin start_expr and a boolean_expr to specify that the search will treat upper and lower case letters the same.

### Note

String indices begin at 1.

### Example

    print instr("Hello", "lo")
    print instr("101,222,333",",",5)

will display

    4
    8

### See Also

Asc, Chr, Count, Countx, Explode, Explodex, Implode, Instr, Instrx, Left, Length, Lower, MD5, Mid, Midx, Replace, Replacex, Right, String, Upper

### History

0.9.6.55 | New to Version

en/instr.txt · Last modified: 2014/02/09 20:48 by admin