Hacker News new | ask | show | jobs
by elFarto 4024 days ago
How about:

  Iterator<String> it = names.iterator();
  while (it.hasNext())
  {
    if (it.next().startsWith("B"))
    {
      it.remove();
    }
  }
1 comments

Yes, much better. For anyone interested, here's a link with background information: http://stackoverflow.com/questions/1196586/calling-remove-in...