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;
}}

posted @ 2013-03-13 20:20  宇的境界  阅读(766)  评论(0编辑  收藏  举报