"please help me "
所以我得到这样的数组:
["please ","help ","me "]
换句话说,我得到一个保留空间(或空格)的数组
谢谢
var str = "please help me "; var split = str.split(/(\S+\s+)/).filter(function(n) {return n});
FIDDLE