Return to Snippet

Revision: 26886
at May 14, 2010 05:47 by adrianparr


Initial Code
function stripSpaces($myString:String):String
{
	return $myString.split(" ").join("");
}


var originalStr:String = "   A   B   C  D     E   F   G    ";
trace("originalStr: "+originalStr);
var withNoSpacesStr:String = stripSpaces(originalStr);
trace("withNoSpacesStr: "+withNoSpacesStr);

// OUTPUT
// originalStr:    A   B   C  D     E   F   G    
// withNoSpacesStr: ABCDEFG

Initial URL

                                

Initial Description

                                

Initial Title
AS3 Strip Spaces from a String

Initial Tags

                                

Initial Language
ActionScript 3