Posted By

adrianparr on 07/10/10


Tagged

regex replace regexp remove new lines as3 returns carriage


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

Nikolai
tspitzr


AS3 Remove Carriage Returns And New Lines Using Regular Expressions


 / Published in: ActionScript 3
 

  1. function removeCarriageReturnsAndNewLines($myString:String):String {
  2. var newString:String;
  3. var findCarriageReturnRegExp:RegExp = new RegExp("\r", "gi");
  4. newString = $myString.replace(findCarriageReturnRegExp, "");
  5. var findNewLineRegExp:RegExp = new RegExp("\n", "gi");
  6. newString = newString.replace(findNewLineRegExp, "");
  7. return newString;
  8. }

Report this snippet  

You need to login to post a comment.