using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
using System.Xml.Linq;
class Program
{
static void Main(string[] args)
{
List<string> myList = new List<string>();
myList.Add("A");
myList.Add("B");
myList.Add("C");
myList.Add("D");
string vanilla = myList.Find(FindVanilla);
Console.WriteLine(vanilla);
}
public static bool FindVanilla(string icecream)
{
return icecream.Equals("B");
}
}
|