正则表达式匹配连续多个空格或tab空格

Pattern p = Pattern.compile("\\s{2,}|\t"); Matcher m = p.matcher(str); String strNoBlank = m.replaceAll(" "); System.out.println(strNoBlank);
相关文章
相关标签/搜索