去掉字符串中的全角空格
全角空格不能用trim()方法去掉,要先转换一下。
String str = str.replace((char) 12288, ' ');
?
避免字符串中还有其他空白字符,所以用如下方法。String str1 = str.replaceAll("\\s*", "");