Answers for "Using Linq to get the last N elements of a collection? C#"

C#
0

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();
Posted by: Guest on September-29-2021

Code answers related to "Using Linq to get the last N elements of a collection? C#"

C# Answers by Framework

Browse Popular Code Answers by Language