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 郭興華 閱讀(203) 評論(0)  編輯  收藏


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


          網站導航:
           
          主站蜘蛛池模板: 会东县| 北川| 基隆市| 漠河县| 邮箱| 兴义市| 长乐市| 林芝县| 聊城市| 行唐县| 上蔡县| 都江堰市| 香河县| 新昌县| 南雄市| 百色市| 乌苏市| 左权县| 抚顺县| 乾安县| 奈曼旗| 玛纳斯县| 大连市| 甘孜| 遂宁市| 邵阳市| 宜昌市| 磐安县| 若尔盖县| 嵊泗县| 房山区| 龙里县| 临清市| 礼泉县| 双辽市| 当雄县| 通州区| 开化县| 新昌县| 淄博市| 浪卡子县|