/**
* str * 过滤空格 */ public static String trimSpaceTag(String str) { String regEx_space = "\\s*|\t|\r|\n";//定义空格回车换行符 Pattern p_space = Pattern.compile(regEx_space, Pattern.CASE_INSENSITIVE); Matcher m_space = p_space.matcher(str); str = m_space.replaceAll(""); // 过滤空格回车标签 return str.trim(); // 返回文本字符串 }