Posted By

adrianparr on 06/22/12


Tagged

remove return break br char tabs chars characters newline as3 tab


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

fergc


AS3 Remove Tabs and NewLine Characters


 / Published in: ActionScript 3
 

If you load text in from an XML file that is wrapped in CDATA tags using 'XML.ignoreWhitespace = true' does not work. This function removes the tabs and linebreaks. To have linebreaks use '<br/>' tags.

  1. private function removeTabsAndNewLines($str:String):String
  2. {
  3. var rex:RegExp = /(\t|\n|\r)/gi;
  4. $str = $str.replace(rex,'');
  5. return $str;
  6. }

Report this snippet  

You need to login to post a comment.