/ Published in: ActionScript 3
This is useful if you are loading html-text via XML and want to remove additional line-breaks, newlines, formfeeds and tabs. It just leaves the clean html.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
public static function removeAsciiFormatting(str:String):String { if (str != null) { var pattern:RegExp = /(\t|\n|\f|\r)*/gm; // remove tabs, newlines, formfeeds and returns return str.replace(pattern, ''); } else { return null; } }