Created
April 13, 2012 18:03
-
-
Save stanosmith/2378835 to your computer and use it in GitHub Desktop.
AS3: Remove Whitespace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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