首页 > 代码库 > 字符转16进制

字符转16进制

package com.charles.utils;

public class String2Hex {

public static void main(String[] args) {

String param = "ccbfc13e-c31d-42ce-8939-3c7e63ed5417";
//63636266633133652d633331642d343263652d383933392d336337653633656435343137
convertString2Hex(param);
}

private static void convertString2Hex(String param) {
if(null == param || 0 == param.length()){
return;
}
for (int index = 0, length = param.length(); index < length; index++) {
Integer data = http://www.mamicode.com/param.codePointAt(index);
System.out.print(Integer.toHexString(data));
}
}

}

字符转16进制