js数组转字符串,字符串转数组 28 February 2010 23:13 Sunday by 小屋 分享收藏

一、数组转字符串(将数组元素用某个字符连接成字符串)

var a, b;

a = new Array(0,1,2,3,4);

b = a.join("-");

 

二、字符串转数组(将字符串按某个字符切割成若干个字符串,并以数组形式返回)

var s = "abc,abcd,aaa";

ss = s.split(",");// 在每个逗号(,)处进行分解。

作者: Sjolzy

--EOF--

引用地址:

相关评论:

  1. gravatar face
    Vibram1937 4 月 01 日 对 “js数组转字符串,字符串转数组” 发表最新评论。
    Hot sales vibram five fingers shoes for men and women, you can buy cheap shoes of classic vibram, kso, bikila, sprint and flow vibram in our online five fingers store.

    Hot sales vibram five fingers shoes for men and women, you can buy cheap shoes of classic vibram, kso, bikila, sprint and flow vibram in our online five fingers store.

      评分:5

  2. 2
    Vibram1937 :

    Hot sales vibram five fingers shoes for men and women, you can buy cheap shoes of classic vibram, kso, bikila, sprint and flow vibram in our online five fingers store.

  3. 1
    小J :

    呵呵,基础不扎实,看来要好好看基础

发表评论:

  给 “js数组转字符串,字符串转数组” 评分

广告、无意义的评论必删!