llgd.net
当前位置:首页 >> jAvA String hEx = "0x01" 如何转成Int? 请教大虾... >>

jAvA String hEx = "0x01" 如何转成Int? 请教大虾...

System.out.println(Integer.parseInt(hex.substring(2), 16));

public static String cvtStr2Hex(String str) { if (str == null) return ""; StringBuilder sb = new StringBuilder(""); for (int i = 0; i < str.length() / 2; i ++) { String sub = str.substring(i*2, i*2 + 2); sb.append("0x" + sub.to...

网站首页 | 网站地图
All rights reserved Powered by www.llgd.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com