赞
踩
方法一:使用replace()方法
String s = "你要去除的字符串"; //去除空格 s = s.replace('\\s',''); //去除回车 s = s.replace('\n',''); //去除水平制表符 s = s.replace('\t',''); //去除换行符 s = s.replace('\r'