I'm trying to make a method that removes all cells that are just spaces from an ArrayList. So far I have this:
This unfortunately seems to return a completely empty ArrayList. Any ideas?
Thanks in advance
Code:
public ArrayList removeSpace()
{
Iterator<String> it = array.iterator();
while (it.hasNext())
{
if (it.next().equals(" "))
{
it.remove();
}
}
return array;
Thanks in advance
Comment