Removing a specific element from a vector
I am wondering how to remove a specific element from a vector.
For example, assume you have the following method:
private var element:String;
private vare Element:Vector<String>;
//This function assumes that Element has elements in it.
public function removeelement(element):Boolean
{
for (var i:int =0; i<Element.length; i++)
{
if (element == String(i)
{
//How do I remove the element assuming it matches?
return true;
}
}
return false;
}
So from the code example above I was using Element.pop() but thats wrong -I think -as it removes the LAST element. I need to remove the element at the location of the match.