日期:2014-05-20 浏览次数:20923 次
public static void main(String[] args) { String s1 = "aa aa aa aa"; String s2 = "b bbb b b"; System.out.println(s1); s1 = s1.replaceAll("\\s+", " "); System.out.println(s1); System.out.println("========================"); System.out.println(s2); s2 = s2.replaceAll("\\s+", " "); System.out.println(s2); }