Posted By

weavermedia on 07/10/09


Tagged

regex String as3


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

weavermedia
sweetbabyyoung
quan
adrianparr


Strip spaces from a String with RegEx


 / Published in: ActionScript 3
 

  1. // strip spaces from oldString
  2.  
  3. var newString:String = String(oldString.replace( /\s/g, "" ));

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: richarddas on July 20, 2009

This apparently only strips a single space out?

Posted By: weavermedia on July 23, 2009

Well spotted richarddas - this is now fixed.

You need to login to post a comment.