java 过滤所有空格

protected boolean allWhite(String s){ //过滤所有空格\
if (s.indexOf(" ") != -1) {
String s2 = s.replaceAll(" ", "");
System.out.println("去掉空格后:" + s2);
return true;
} else {
System.out.println("没有空格");
return false;
}}

原文地址:https://www.cnblogs.com/zhang747725388/p/2958203.html