Using Linq to get the last N elements of a collection C#

91

Using Linq to get the last N elements of a collection? C# -

List<string> mystring = new List<string>() { "one", "two", "three" }; 
mystring = Enumerable.Reverse(mystring).Take(2).Reverse().ToList();

Comments

Submit
0 Comments