indexOf

The indexOf method returns the position of the first occurrence of a specified value in a string.

 

Syntax

System.Int32 indexOf(System.String searchvalue, System.Int32 start);

 

Parameters

searchvalue

String to search for

start

[Optional] Index position to start the search. Default 0.

 

Return Value

Returns the position of the first occurrence, or -1 if the string doesn't exist.

 

Remarks

Member of string.

 

Example