How can one remove whitespace from a string in as3?
I would like to be able to remove all carriage returns, spaces, tabs etc.
Tested and works on AnimateCC for iOS air app:
// Regular expressions
var spaces:RegExp = / /gi; // match "spaces" in a string
var dashes:RegExp = /-/gi; // match "dashes" in a string
// Sample string with spaces and dashes
loginMC.userName.text = loginMC.userName.text.replace(spaces, ""); // find and replace "spaces"
loginMC.userName.text = loginMC.userName.text.replace(dashes, ":"); // find and replace "dashes"
trace(loginMC.userName.text);