用逗号分隔数组

时间:2015-12-03 16:42:04

标签: arrays actionscript-3

我想将此数组转换为长度为1:

var myArray = ("The,boy,and,the,girl")

到长度为5的数组:

myArray = ("The","boy","and","the","girl")

1 个答案:

答案 0 :(得分:4)

您可以在数组中的字符串上使用方法.split()

myArray  = myArray[0].split(",");

http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=00001555.html