Use split(String, index) to split String to array of strings
package{
import flash.display.Sprite;
public class Main extends Sprite{
public function Main(){
var sentence:String = "The quick brown fox jumped over the lazy dog";
var words:Array = sentence.split("", 4); // limit to 4 elements.
trace(words);
}
}
}
Related examples in the same category