Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

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();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Using #Linq #N #elements
ADD COMMENT
Topic
Name
3+7 =