Find

Description

This function finds a string (find$) within another string (within$), starting from position (StartPos), and returns the starting position of find$ in within$. Unlike the Search function, the Find function is case sensitive. The Find function does not allow wildcard characters.

Syntax

int Find(string within$, string find$ [, int StartPos = 1])

NOTE: Order of string arguments is reverse of MS Excel.

Parameters

within$

is the containing string.

find$

is the string you want to find.

StartPos

specifies the position of the character at which to start the search. The default value is 1, which says "begin search from the first character."

Return

If the string has been found, return the position of the string.

If the string has not been found, return -1.

Examples

string str1$ = "abcde";
string str2$ = "bc";
int position = Find(str1$,str2$);
position = ; //should return 2

See Also

Search, MatchBegin, MatchEnd, FindOneOf, GetToken