子串在主机中出现的位置indexOf()--简单
生活随笔
收集整理的這篇文章主要介紹了
子串在主机中出现的位置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()函數用處大
}
}
運行結果:
?
轉載于:https://www.cnblogs.com/duanqibo/p/11132983.html
總結
以上是生活随笔為你收集整理的子串在主机中出现的位置indexOf()--简单的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Mybatis-Plus插件配置
- 下一篇: MongonDB 知识