Java ascii码值转为输出ascii码
public static void main(String[] args) { // TODO Auto-generated method stub String a = " 01"; if(" 01".equals(a)){ a = "001"; int b = Integer.valueOf(a); //转为ascii char c = (char)b; //转为String String d = String.valueOf(c); System.out.println(">>>>>>c:"+c); System.out.println(">>>>>>d:"+d); } }
输出结果:
>>>>>>c:
>>>>>>d: