去掉空格、回车、换行符、制表符
?
public static String replaceBlank(String str) { String a= ""; if (str!=null) { Pattern p = Pattern.compile("\\s*|\t|\r|\n"); Matcher m = p.matcher(str); a= m.replaceAll(""); } return a; }