5

1つのアイテム(コンマで区切られたアイテムの束を含むSTRING)を含むこの配列を取得したい

["Bucknell Venture Plan Competition, Mitch Blumenfeld, DreamIt Ventures, Deep Fork Capital, John Ason, Mitchell Blumenfeld, Gianni Martire"]

これに変えたいです。各名前を個別の配列項目として含む配列。

["Bucknell Venture Plan Competition", "Mitch Blumenfeld", "DreamIt Ventures", "Deep Fork Capital", "John Ason", "Mitchell Blumenfeld", "Gianni Martire"]

ありがとう!

アップデート:

助けてくれてありがとう。それはうまくいきました!

4

2 に答える 2

9

単純なもの:

var myArr = ["Bucknell Venture Plan Competition, Mitch Blumenfeld, DreamIt Ventures, Deep Fork Capital, John Ason, Mitchell Blumenfeld, Gianni Martire"];
var myNewArr = myArr[0].split(",");
于 2012-05-11T15:41:31.120 に答える
5

私はこれがうまくいくと思います:

var items = ["Bucknell Venture Plan Competition, Mitch Blumenfeld, DreamIt Ventures, Deep Fork Capital, John Ason, Mitchell Blumenfeld, Gianni Martire"];
var array = items[0].split(",");
于 2012-05-11T15:42:50.940 に答える