JavaScript 中
split() 方法用于把一个字符串分割成字符串数组.
var str="How are you doing today?";
var n=str.split(" ");
上面是以空格分隔
结果How,are,you,doing,today?
JavaScript 中
split() 方法用于把一个字符串分割成字符串数组.
var str="How are you doing today?";
var n=str.split(" ");
上面是以空格分隔
结果How,are,you,doing,today?