Difference between the String methods indexOf( ) and lastIndexOf( )1. The method indexOf() returns the first occurrence (index) of a given character or a combination as parameter in a given string.
2. The method lastIndexOf() returns the last occurrence (last index) of a given character or combination in a given string.
|