Remove spaces from array
I have an array of 13 items (all of which are letters EX e,e,e,e ...). It is being read in from a database. However, I want to loop through the array and clean out any spaces that it might have. I am having trouble doing this. Anyone done this before?
Here is what I have so far.
outputBox.autoSize = TextFieldAutoSize.LEFT;
displayArray(system.selectedAnswers.length);
function displayArray(n:int):void {
for (var i:int = 0; i < n; i++)
{
system.selectedAnswers.replace(/^\s+|\s+$/g, "");
outputBox.appendText(String(system.selectedAnswers) + ",");
}
}
Thanks.
