I have a List and i need to take a sublist out of this list. Is there any methods of List available for this in .NET 3.5?
List
Reverse the items in a sub-list
int[] l = {0, 1, 2, 3, 4, 5, 6}; var res = new List(); res.AddRange(l.Where((n, i) => i < 2)); res.AddRange(l.Where((n, i) => i >= 2 && i <= 4).Reverse()); res.AddRange(l.Where((n, i) => i > 4));
Gives 0,1,4,3,2,5,6