Yoshi9143 Yoshi9143 - 3 years ago 241
C# Question

How do I truncate a list in C#?

I know in python you can do something like

myList[1:20]
but is there anything similar in C#?

Answer Source
var itemsOneThroughTwenty = myList.Take(20);
var itemsFiveThroughTwenty = myList.Skip(5).Take(15);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download