java技術博客

          jsp博客
          <2008年10月>
          2829301234
          567891011
          12131415161718
          19202122232425
          2627282930311
          2345678

          統計

          • 隨筆 - 84
          • 文章 - 1
          • 評論 - 2
          • 引用 - 0

          常用鏈接

          留言簿(3)

          隨筆分類

          隨筆檔案

          文章檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          FindSubstring.java
          /**
          *查找特定的子串
          */
          public class FindSubstring{
          public static void main(String[] args){
          String str="Welcome the body.";
          System.out.println("Find the substring boy occurrence:"+str.indexOf("boy"));//查找子串
          System.out.println("Find the substring by occurrence: "+str.indexOf("by"));//查找子串
          System.out.println("Find the char t occurrence: "+str.indexOf('t'));//查找特定的字符
          System.out.println("Test the string begin with wel.:"+str.startsWith("wel"));//是否以"wel"開始
          System.out.pritnln("Test the string end with body.:"+str.endWith("boy"));//是否以"boy"結束
          }
          }

          posted on 2008-10-22 13:06 郭興華 閱讀(202) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 同仁县| 勃利县| 句容市| 和政县| 天等县| 大足县| 伊宁县| 义马市| 高台县| 彩票| 光山县| 新丰县| 正安县| 平昌县| 梓潼县| 麻江县| 东兰县| 南阳市| 昌乐县| 甘南县| 昆山市| 迁西县| 绥江县| 郸城县| 手机| 文昌市| 定襄县| 和静县| 上高县| 内丘县| 丰顺县| 藁城市| 长垣县| 凤庆县| 镇赉县| 会同县| 青龙| 睢宁县| 乌兰察布市| 肇东市| 镇赉县|