数组转换为字符串,字符串转换为数组

var _str="abc789466";
var
obj=_str.toString().replace(/(.)(?=[^$])/g,"$1,").split(","); //字符串转化为数组 var obj2 = "new2abcdefg".split(""); //字符串转化为数组 alert(obj); alert(obj.length); alert(obj instanceof Array); alert(obj.join("")); //数组转化为字符串

 

posted on 2017-09-28 20:52  城里的月光  阅读(193)  评论(0编辑  收藏  举报

导航