• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            熱轉(zhuǎn)印www.yxheatpress.com

            公司網(wǎng)站模板http://qiyemoban.software8.co/

            常用鏈接

            統(tǒng)計(jì)

            友情鏈接

            最新評論

            【你不知道的Java】-漢字轉(zhuǎn)換拼音

            一:

            String cnStr = "釣魚島是中國的";

            diao yu dao shi zhong guo de 

            二:code

            1. public static String getPinYin(String src) {  
            2.         char[] t1 = null;  
            3.         t1 = src.toCharArray();  
            4.         // System.out.println(t1.length);  
            5.         String[] t2 = new String[t1.length];  
            6.         // System.out.println(t2.length);  
            7.         // 設(shè)置漢字拼音輸出的格式  
            8.         HanyuPinyinOutputFormat t3 = new HanyuPinyinOutputFormat();  
            9.         t3.setCaseType(HanyuPinyinCaseType.LOWERCASE);  
            10.         t3.setToneType(HanyuPinyinToneType.WITHOUT_TONE);  
            11.         t3.setVCharType(HanyuPinyinVCharType.WITH_V);  
            12.         String t4 = "";  
            13.         int t0 = t1.length;  
            14.         try {  
            15.             for (int i = 0; i < t0; i++) {  
            16.                 // 判斷能否為漢字字符  
            17.                 // System.out.println(t1[i]);  
            18.                 if (Character.toString(t1[i]).matches("[\\u4E00-\\u9FA5]+")) {  
            19.                     t2 = PinyinHelper.toHanyuPinyinStringArray(t1[i], t3);// 將漢字的幾種全拼都存到t2數(shù)組中  
            20.                     t4 += t2[0]+" ";// 取出該漢字全拼的第一種讀音并連接到字符串t4后  
            21.                 } else {  
            22.                     // 如果不是漢字字符,間接取出字符并連接到字符串t4后  
            23.                     t4 += Character.toString(t1[i]);  
            24.                 }  
            25.             }  
            26.         } catch (BadHanyuPinyinOutputFormatCombination e) {  
            27.             e.printStackTrace();  
            28.         }  
            29.         return t4;  
            30.     }  

            posted on 2012-10-17 09:50 不聽話的 閱讀(1153) 評論(2)  編輯 收藏 引用

            評論

            # re: 【你不知道的Java】-漢字轉(zhuǎn)換拼音 2012-10-17 17:49 王世雄

            有意思呵呵。不過釣魚島是日本的。  回復(fù)  更多評論   

            # re: 【你不知道的Java】-漢字轉(zhuǎn)換拼音[未登錄] 2013-05-04 14:59 albert

            不怎么樣,就是簡單地詞典啊?  回復(fù)  更多評論   


            只有注冊用戶登錄后才能發(fā)表評論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


            久久久久亚洲精品天堂| 狼狼综合久久久久综合网| 亚洲嫩草影院久久精品| 国产成人AV综合久久| 久久久久无码中| 久久久久久午夜成人影院| 久久精品成人国产午夜| 久久亚洲中文字幕精品一区四| 久久久久久免费视频| 丰满少妇人妻久久久久久| 99久久成人18免费网站| 久久精品成人欧美大片| 国产午夜福利精品久久| 97久久国产综合精品女不卡 | 无码专区久久综合久中文字幕| 久久99热精品| 99精品国产免费久久久久久下载| 久久精品国产亚洲AV高清热| 久久精品国产精品亚洲| 国产精品一区二区久久| 色欲综合久久躁天天躁蜜桃| 久久久精品久久久久久| 国产一区二区三区久久精品| 久久香蕉超碰97国产精品| 久久精品国产欧美日韩99热| 久久久久无码精品| 国产精品成人99久久久久91gav| 国产精品美女久久久m| 久久人与动人物a级毛片| 香蕉99久久国产综合精品宅男自| 久久综合狠狠色综合伊人| 国产精品久久久久AV福利动漫| A级毛片无码久久精品免费| 亚洲欧美成人久久综合中文网| 久久996热精品xxxx| 精品久久久久中文字幕一区| 久久香蕉一级毛片| 办公室久久精品| 久久九九久精品国产| 久久99精品国产麻豆婷婷| 久久久久国产日韩精品网站|