inStr
Top  Previous  Next

val = inStr(str1, str2)

Returns the position (zero-based) of the first occurrence of one string within another.

Parameters
 
str1  
 
String being searched. If not string, converted to string.  
str2  
 
String searched for. If not string, converted to string.  

Remarks

inStr returns -1 if str2 was not found within str1.  
Search is case-sensitive.  

Example


a = inStr("Hello", "e")
' Returns 1.
a = inStr("Hello", "He")
' Returns 0.
a = inStr("Hello", "abc")
' Not found. Returns -1.