Use regular expression in split method : Split : String Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » String » Split »

 

Use regular expression in split method


 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
        var example:String = "Here are some words. Also, here is some punctuation!";
        var words:Array = example.split/[^a-zA-Z0-9]+/ );
        
        for (var i:int 0; i < words.length; i++ ) {
          tracewords[i] );
        }
    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo String
» Split