package chapter_6;
public class exa_03 {
public static void main(String []args)
{
String str1="good morning";
System.out.print("子串orn在主串中的位置是:");
System.out.println(str1.indexOf("orn")); //indexOf()函数用处大
}
}
运行结果:
package chapter_6;
public class exa_03 {
public static void main(String []args)
{
String str1="good morning";
System.out.print("子串orn在主串中的位置是:");
System.out.println(str1.indexOf("orn")); //indexOf()函数用处大
}
}
运行结果: