var t:String = “hello amy flash”;

var myPattern:RegExp=/([ ]{1})/g;
t=t.replace(myPattern,””);
trace(t);//output:helloamyflash