Skip to content

Instantly share code, notes, and snippets.

@stanosmith
Created April 13, 2012 18:03
Show Gist options
  • Save stanosmith/2378835 to your computer and use it in GitHub Desktop.
Save stanosmith/2378835 to your computer and use it in GitHub Desktop.
AS3: Remove Whitespace
private var whitespace:String = " \t\n\r"; /**< Whitespace characters (space, tab, new line and return). */
private function removeWhitespace(source:String):String {
var pattern:RegExp = new RegExp('[' + whitespace + ']', 'g');
return source.replace(pattern, '');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment