I know in python you can do something like myList[1:20] but is there anything similar to C#?
Thanks!
I know in python you can do something like myList[1:20] but is there anything similar to C#?
Thanks!
var itemsOneThroughTwenty = myList.Take(20);
var itemsFiveThroughTwenty = myList.Skip(5).Take(15);
You can use List.GetRange():
var subList = myList.GetRange(0, 20);