var a = "h|el|lo";
var b = "hello";
//指定分隔符进行分割
console.log(a.split("|"));
//分割每个字符
console.log(b.split(""));
//空参数,返回原字符
console.log(b.split());
//分割每个字符,但设置长度,只保留前面3个内容
console.log(b.split("",3));
var a = "h|el|lo";
var b = "hello";
//指定分隔符进行分割
console.log(a.split("|"));
//分割每个字符
console.log(b.split(""));
//空参数,返回原字符
console.log(b.split());
//分割每个字符,但设置长度,只保留前面3个内容
console.log(b.split("",3));
info 还没有任何评论,你来说两句呐!