Thursday, September 20, 2018

Getting a subset of a list in C# is a lot like getting a substring.

This should pull the 4 and the 5 below out into its own list.

List<int> eight = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8 }
List<int> crazy = eight.GetRange(3, 2);

No comments:

Post a Comment