User Tools

Site Tools


Instr (Function)



Check to see if the string needle_string_expression is contained in the string haystack_string_expression. If it is, then this function will return the index of starting character of the first place where needle_string_expression occurs. Otherwise, this function will return 0.

You may optionally specify a starting location for the search to begin start_expression. If the start is 1 or greater the search will begin from the specified character from the start. If the start is < 0 then the search will begin from the nth character from the end. The search will ALWAYS look forward.

An optional boolean_expression may be used to specify that the search will treat upper and lower case letters the same.


String indices begin at 1.


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

will display


See Also

History to Version start position < 0
en/instr.txt · Last modified: 2016/08/13 07:59 by admin