Posted By

nicoptere on 08/11/11


Tagged

text


Versions (?)

compactString


 / Published in: ActionScript 3
 

  1. private function compactString( s:String ):String
  2. {
  3.  
  4. var tmp:Array = s.replace( /[ ]+/g, '' ).toLowerCase().split('');
  5. tmp.sort();
  6. var _s:String = '';
  7. for ( var i:int = 0; i < tmp.length; i++ ) _s += tmp[i];
  8. return _s.replace( /[ ]+/g, '' );
  9.  
  10. }

Report this snippet  

You need to login to post a comment.