// Declare a Func variable and assign a lambda expression to the // variable. The method takes a string and converts it to uppercase. Func<string, int, string> selector = delegate(string s, int i) { if (i == 3) return s.ToUpper(); else return "Whatever"; }; // Create an array of strings. string[] words = { "orange", "apple", "Article", "elephant" }; // Query the array and select strings according to the selector method. IEnumerable<String> aWords = words.Select(selector); // Output the results to the console. foreach (String word in aWords) Console.WriteLine(word);