Updated 2012-10-30 15:33:02 by dkf
string first string1 string2 ?startIndex?

Search string2 (the haystack) for a sequence of characters that exactly match the characters in string1 (the needle). If found, return the index of the first character in the first such match within string2. If not found, return “-1”. If startIndex is specified (in any of the forms accepted by string index), then the search is constrained to start with the character in string2 specified by the index. For example,
string first a 0a23456789abcdef 5

will return “10”, but
string first a 0123456789abcdef 11

will return “-1”.


See also edit