我也提出问题

保留原著,并且问题被回答或审核通过时通知你:


Tag Archives: 字符串

把字符串转成数组。

使用String.split()方法:
var list:String = “flash,flex,swf”;
var words:Array = list.split(“,”); // 以逗号作为分隔符将字符串切割
trace(words); //输出: flash,flex,swf
- 作者:SWFAQ | http://swfaq.org

把数组转成字符串。

使用String.join()方法:
var myArr:Array = new Array(“one”, “two”, “three”);
var myStr:String = myArr.join(” and “);
trace(myArr); //输出: one,two,three
trace(myStr); //输出: one and two and three
- 作者:SWFAQ | http://swfaq.org