public void filter(String s){
String[] b = s.split("\\s+");
StringBuffer stringBuffer = new StringBuffer();
for(String c:b){
stringBuffer.append(" "+c);
}
System.out.print(stringBuffer.toString());
}
原文地址:http://blog.51cto.com/golearning/2087870