将字符串弄成数组String str="asdf dfd dfd dfwe sdfsdf erew"; String[] dd=str.split("\\s+"); for(String s : dd){ System.out.println(s); }