Created
February 29, 2012 15:17
-
-
Save alexyork/1941487 to your computer and use it in GitHub Desktop.
The beauty of LINQ lambda's
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var names = new[] { "Bill", "Bill", "Bob", "Mary", "Bartholomew", "Shane", "Elisabeth", "Dave", "Bartholomew" }; | |
var query = names.Distinct() | |
.Where(n => n.Length > 6) | |
.OrderByDescending(n => n) | |
.ToArray(); | |
// result: { "Elisabeth", "Bartholomew" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment