Find string in string

Syntax

int find(string substring [from] [flags])

 

Parameters

string - string to search in.

substring - substring to find.

from - 0-based character index, from which to start search. Default 0.

flags:

1 case insensitive.

 

Remarks

Returns 0-based index of first character of substring in string. If substring not found, returns -1.

 

Tips

To make more precise search, use findw or findrx.

 

Example

str s = "Notepad.exe"
int i = find(s ".exe")
 now i is 7