Removing Spaces from a String in Flex / ActionScript 3

If you want to remove any characters from a string using actionscript the following two line code can be used.  The following code removes spaces from a string :

public function removeSpaces(strOriginal:String):String{
var origArr:Array=strOriginal.split(” “);
return(origArr.join(“”));
}

That’s it guys. Happy Coding 🙂

Advertisements

Tags: , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: