Last active
May 3, 2016 13:30
-
-
Save csdear/ec9e021aa3672915be70 to your computer and use it in GitHub Desktop.
Easy List and a Lambda Expression
This file contains hidden or 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
| //linqpad as C# Program... | |
| //using System; | |
| //using System.Collections.Generic; | |
| //For finding one quick element... | |
| class Program | |
| { | |
| static void Main() | |
| { | |
| List<int> list = new List<int>(new int[] { 19, 23, 29 }); | |
| // Finds first element greater than 20 | |
| int result = list.Find(item => item > 20 ); | |
| Console.WriteLine(result); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment