java:替换字符串中的ASCII码

可对照查看网盘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+" ");
}

  

上一篇:java 替换字符串模板(模板渲染)


下一篇:洛谷P1972 HH的项链