|
发表于 2020-7-27 16:00:01
|
显示全部楼层
private static String getASCIICode(String normalStr) {
StringBuffer buffer = new StringBuffer();
byte[] bitArray = normalStr.getBytes();
int length = bitArray .length;
for (int i = 0; i < length; i++)
{
buffer.append(Integer.toHexString(bitArray [i]));
}
return (new String(buffer));
}
//仅限英文字符串
给分! 给分! 呵呵 |
|