String.indexOf()

Availability

Flash Player 5.

Usage

my_str.indexOf(substring, [startIndex])

Parameters

substring An integer or string specifying the substring to be searched for within my_str.

startIndex An optional integer specifying the starting point in my_str to search for the substring.

Returns

The position of the first occurrence of the specified substring, or -1.

Description

Method; searches the string and returns the position of the first occurrence of substring found at or after startIndex within the calling string. If substring is not found, the method returns -1.

See also

String.lastIndexOf()