public
int lastIndexOf(int ch)
Returns
the index within this string of the last occurrence of the specified
character.
class StringLastIndexOf{ public static void main(String args[]){ String s1 = "wxyzabdabdda"; System.out.print("Last index of d is : "); System.out.println(s1.lastIndexOf('d')); } }
Output
Last index of d is : 10
No comments:
Post a Comment