Say I have an iterator.
After iterating over a few items of the iterator, I will have to get rid of these first few items and return an iterator(preferably the same) with the rest of the items. How do I go about?
Also, Do iterators support remove or pop operations (like lists)?
Say I have an iterator. After iterating over a few items of the iterator,
Share
Yes, just use iter.next()
Example
You can pop off the front of an iterator with .next(). You cannot do any other fancy operations.