注意: 不要在split方法中写" ", 这样只能匹配到一个空格
String s = "hello world you"; String[] split = s.split("\\s+"); for (String s1 : split) { System.out.println(s1); }