split() method can be called using a RegExp object instead of a string as the delimiter
package{
import flash.display.Sprite;
public class Main extends Sprite{
public function Main(){
var reCase:RegExp = new RegExp("[ ,]", "ig");
var sVal = new String("ActionScript Bible, Flash Bible");
var aVals:Array = sVal.split(reCase);
trace(aVals);
}
}
}
Related examples in the same category