lastIndexOf

The lastIndexOf method returns the position of the last occurrence of a specified value in a string.

 

Syntax

System.Int32 lastIndexOf(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 last occurrence, or -1 if the string doesn't exist.

 

Remarks

Member of string.

 

Example