优质文章外链发布 5元/条 QQ:2970302840 广告(购买广告位、友情链接)
Camila Waz 发布于
2019-12-04 17:01:06

字符串转数组split()函数和数组转字符串join()函数实例

字符串转数组split()函数和数组转字符串join()函数实例
var string="abcdefg"
console.log(string.split(''));
// 输出结果:["a", "b", "c", "d", "e", "f", "g"]

var array=["a", "b", "c", "d", "e", "f", "g"];
console.log(array.join(','));
// 输出结果:a,b,c,d,e,f,g
当前文章内容为原创转载请注明出处:http://www.good1230.com/detail/2019-11-28/506.html
最后生成于 2020-07-03 20:31:06