可对照查看网盘ASCII表http://yunpan.cn/cyxg4wQjQaGEQ (提取码:8b29)
public static void main(String[] args) { // // TODO Auto-generated method stub int a=001; int b=32;//制表符 int c=13;//回车键 char character = (char)a; char cb = (char)b; String line ="niaho" + character + "woma"; String ar= String.valueOf(character); //int转化成字符串,为1 String line2=line.replace(character, cb);//// replace(oldchar,newchar) System.out.println("line:"+line+" "); System.out.println("line:"+line2+" "); }