Back To Java String Class Index
//program to demonstrate indexof method of String class public class stringindexof { public static void main(String[] args) { String ob=new String("abcdef"); int index; index=ob.indexOf("ab"); System.out.println("index of ab in string is " + index); } }