`
qq123zhz
  • 浏览: 524480 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

js 字符串转为字符数组

 
阅读更多

测试代码:"abdaffwead".replace(/(.)(?=[^$])/g,"$1,")

<script type="text/javascript">
var obj="abdaffwead".replace(/(.)(?=[^$])/g,"$1,").split(",");
alert(obj);
alert(obj.length);
alert(obj instanceof Array);
</script>

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics