This seems like a very basic thing to do, but I can't find any methods to do this. I've checked Intellisense and searched Google with no luck.
I have an ItemCollection with ~30 items in it. I'm trying to get the first 14 items to remain in the original ItemCollection and the latter 16 (or however many) moved to a new ItemCollection.
How can I do this? myVar.CopyTo() would be ok, but there is no parameter for the number of items to copy, and it only accepts an Array for output. Looping over myVar.RemoveAt() seems expensive. Is there a built-in method? Is it possible with Linq?
If you could convert the
ItemCollectioninto anArrayList; then you can try this:This removes
yelements starting at indexx.Finally you could convert the
ArrayListback to anItemCollection.This is useful if you have too many items in the collection.