日期:2014-05-20  浏览次数:20720 次

字符串-->hex-->字符串
RT:
  String str = "48 65 6C 6C 6F";
  .....
  -->
  String str = "hello";
怎么得出?

------解决方案--------------------
Java code


String s = "48 65 6C 6C 6F";
String[] arr = s.split(" ");
StringBuffer sb = new StringBuffer();
for (int ii=0;ii<arr.length;ii++){
    sb.append((char)Integer.valueOf((arr[ii]), 16).intValue());
}
        
System.out.println(sb.toString());

------解决方案--------------------
汗,我在那个帖中已经回复给你了,在 9 楼上

http://topic.csdn.net/u/20080326/13/9ca1121b-78ff-42ca-8bf5-a254076300bb.html