在字符串中划分几个img标签

时间:2011-01-31 08:34:36

标签: actionscript-3

我有一个看起来像这样的字符串:

"assets/images/1.jpg;assets/images/2.jpg;assets/images/3.jpg";

如何创建一个数组来推送其中的每个链接并删除;?

类似的东西:

var images:Array = {assets/images/1.jpg,assets/images/2.jpg,assets/images/3.jpg};

1 个答案:

答案 0 :(得分:1)

使用

s = "assets/images/1.jpg;assets/images/2.jpg;assets/images/3.jpg";
a = s.split(";");

http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary696.html