public static String replaceAllBlank(String str) {
String s = "";
if (str!=null) {
Pattern p = Pattern.compile("\\s*|\t|\r|\n");
/* \n 回车(\u000a) \t 水平制表符(\u0009) \s 空格(\u0008) \r 换行(\u000d) */
Matcher m = p.matcher(str);
s = m.replaceAll("");
}
return s;
}
String s = "";
if (str!=null) {
Pattern p = Pattern.compile("\\s*|\t|\r|\n");
/* \n 回车(\u000a) \t 水平制表符(\u0009) \s 空格(\u0008) \r 换行(\u000d) */
Matcher m = p.matcher(str);
s = m.replaceAll("");
}
return s;
}