posts - 33,  comments - 17,  trackbacks - 0
           1/**
           2 * 用半角的特殊符號代替全角的特殊符號
           3 * 防止特殊字符在傳輸參數(shù)時出現(xiàn)錯誤
           4 * 
           5 */

           6
           7public class ReplaceStrE{
           8    public static String rightToError(String ss){
           9        String strs;
          10        String strs1;
          11        String strs2;
          12        String strs3;
          13        String strs4;
          14        try{
          15            strs = ss.replace('','#');
          16        }

          17        catch(Exception ex){
          18            return ss;
          19        }

          20        
          21        try{
          22            strs1 = strs.replace('','"');
          23        }

          24        catch(Exception ex){
          25            return strs;
          26        }

          27        
          28        try{
          29            strs2 = strs1.replace('  ','&');
          30        }

          31        catch(Exception ex){
          32            return strs1;
          33        }

          34        
          35        try{
          36            strs3 = strs2.replace('','+');
          37        }

          38        catch(Exception ex){
          39            return strs2;
          40        }

          41        
          42        try{
          43            strs4 = strs3.replace('','\'');
          44        }

          45        catch(Exception ex){
          46            return ss;
          47        }

          48        return strs4;
          49    }

          50}
          posted on 2008-07-23 17:36 scea2009 閱讀(876) 評論(0)  編輯  收藏

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


          網(wǎng)站導(dǎo)航:
           

          <2008年7月>
          293012345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          常用鏈接

          留言簿(1)

          隨筆分類

          隨筆檔案

          PL/SQL存儲過程與函數(shù)

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 安康市| 彭阳县| 桂阳县| 三门峡市| 慈利县| 桑日县| 诸暨市| 历史| 安庆市| 福鼎市| 西华县| 威远县| 江津市| 合江县| 达日县| 新营市| 龙游县| 鞍山市| 尉犁县| 浦县| 永胜县| 澄迈县| 乐陵市| 宁晋县| 万源市| 霍林郭勒市| 喀喇| 宿迁市| 科技| 济南市| 洱源县| 香港 | 涿州市| 曲周县| 凤凰县| 兴安盟| 浦城县| 贵港市| 南乐县| 高陵县| 留坝县|