Posted By

gromitski on 02/28/11


Tagged

actionscript regex


Versions (?)

Remove non alpha numeric characters from a string


 / Published in: ActionScript
 

URL: http://gromitski.com/blog/removing-non-alpha-numeric-characters-from-a-string/

Useful for stripping out backslashes, hyphens and other punctuation

  1. var r:RegExp = new RegExp(/[^a-zA-Z 0-9]+/g) ;
  2. yourString = yourString.replace(r, "");

Report this snippet  

You need to login to post a comment.