posts - 21,  comments - 6,  trackbacks - 0
          1?如何將字串?String?轉換成整數?int??

          A.?有兩個方法:

          1).?int?i?=?Integer.parseInt([String]);?或?
          i?=?Integer.parseInt([String],[int?radix]);

          2).?int?i?=?Integer.valueOf(my_str).intValue();?

          注:?字串轉成?Double,?Float,?Long?的方法大同小異.?


          2?如何將整數?int?轉換成字串?String???


          A.?有叁種方法:

          1.)?String?s?=?String.valueOf(i);

          2.)?String?s?=?Integer.toString(i);?

          3.)?String?s?=?""?+?i;?

          注:?Double,?Float,?Long?轉成字串的方法大同小異.?
          posted on 2006-09-19 17:17 Warren.Wu 閱讀(265) 評論(0)  編輯  收藏

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


          網站導航:
           
          主站蜘蛛池模板: 石屏县| 淮南市| 江津市| 屏东县| 荆州市| 华池县| 南通市| 公安县| 冀州市| 平乡县| 台中县| 吴堡县| 礼泉县| 衡东县| 汶川县| 哈巴河县| 缙云县| 临城县| 黄平县| 景德镇市| 林西县| 岳池县| 肥乡县| 安阳县| 两当县| 双辽市| 随州市| 武穴市| 孝义市| 新野县| 兴宁市| 信宜市| 兰考县| 远安县| 沈丘县| 登封市| 吴江市| 深州市| 武鸣县| 齐河县| 万全县|