CSharp examples for Custom Type:Lambda
A predicate lambda expression with an array's Find() method:
using System;/* w ww . j a v a 2s. c o m*/ using System.Collections.Generic; class Program { static void Main(string[] args) { List<int> numbers = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 }; int[] numArray = numbers.ToArray(); Console.WriteLine("\n1. Finding the first number greater than 4: "); int firstGreaterThanFor = Array.Find(numArray, n => n > 4); Console.WriteLine("\t{0}", firstGreaterThanFor.ToString()); } }