Converting a String to an Array: Use the String.split(delimiter, maximum_number_of_elements_to_place_into_the_new_array) method.
package{
import flash.display.Sprite;
public class Main extends Sprite{
public function Main(){
var list:String = "Piper picked a peck of pickled peppers";
var words:Array = list.split(" ");
trace(words);
}
}
}
Related examples in the same category