Java String indexOf(String str) 方法 Java String indexOf(int ch, int fromIndex) Java String indexOf(String str, int fromIndex) Java String indexOf(String str) 方法 import java.io.*; public class Test { public static void main(String args[]) { String Str = new String("Welcome to codingdict.com"); String SubStr1 = new String("Tutorials"); System.out.println("Found Index :" + Str.indexOf( SubStr1 )); } } Java String indexOf(int ch, int fromIndex) Java String indexOf(String str, int fromIndex)