using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
class MainClass
{
public static void Main()
{
string[] currentVideoGames = {"Shooting", "D","Half Life", "F.E.A.R.","Game", "System"};
Func<string, bool> searchFilter = new Func<string, bool>(Filter);
Func<string, string> itemToProcess = new Func<string,string>(ProcessItem);
var subset = currentVideoGames.Where(searchFilter).OrderBy(itemToProcess).Select(itemToProcess);
foreach (var game in subset)
Console.WriteLine("Item: {0}", game);
}
public static bool Filter(string s) {return s.Length > 6;}
public static string ProcessItem(string s) { return s; }
}
|