转自 :http://www.cnblogs.com/fsjohnhuang/p/4098623.html
package regex; public class GetSingleString { public static void main(String[] args) { String s="aaaa bbbb cccc"; String[] split = s.split("\s+"); System.out.println(split.length); for(String each : split ) { System.out.println( each ) ; } } }