每一个字符都会有对应的ASCII码,下面举例在Java中将两者互相转换:
<span style="white-space:pre"> </span>String a = "asd";
char[] ch = a.toCharArray();
for (int i = 0; i < ch.length; i++) {
int backnum = (int) ch[i];
System.out.println("ch"+ch[i]+":" + backnum);
char strChar = (char) backnum;
System.out.println("strChar :" +strChar);
}