What would be the most efficient way to select all the items in a specific range from a list and put it in a new one?
List<DataClass> xmlList = new List<DataClass>();
This is my List, and I would like to put all the DataClass items between the range (3 – 7) in a new List.
What would be the most efficient way? A foreach loop that that count++ everytime untill he reaches the items between a the range and add those items to the new list?
The method you are seeking is GetRange:
From the summary: