Java tutorial
public class MainClass { public static void main(String args[]) { String letters = "abcdefghijklmabcdefghijklm"; System.out.printf("\"def\" is located at index %d\n", letters.indexOf("def")); System.out.printf("\"def\" is located at index %d\n", letters.indexOf("def", 7)); System.out.printf("\"hello\" is located at index %d\n\n", letters.indexOf("hello")); } }