Java ascii码值转为输出ascii码 public static void main(String[] args) { // TODO Auto-generated method stub String a = "\001"; if("\001".equals(a)){ a = "001"; int b = Integer.valueOf(a); //转为ascii char c = (char)b; //转为String String
常见字符的ASCII码值如下:空格的ASCII码值为32:数字0到9的ASCII码值分别为48到57:大写字母"A"到"Z"的ASCII码值分别为65到90:小写字母"a"到"z"的ASCII码值分别为97到到122. int a = '2'; -----> out:50 解析:0为48,48+2=50 表示的就是2