用正则表达式把字符串转化成数组

var r=/s+/;//适配一个或多个空格

var arr=str.split(r);//js中的字符串split方法能用正则表达式

原文地址:https://www.cnblogs.com/xjt360/p/3989741.html