using System;
using System.Collections.Generic;
using System.Text;
namespace MyDelegate
{
class Program
{
static void Main(string[] args)
{
List
<string> m_liName=new List<string>();
m_liName.Add(
"sadi");
m_liName.Add(
"pothik");
m_liName.Add(
"shiman");
m_liName.Add(
"shuvro");
m_liName.Add(
"arif");

//**************Find a single data
string sName = m_liName.Find(delegate(string s)
{
return s.Equals("sadi"); });

//**************Find multiple data
List<string> liName1 = m_liName.FindAll(delegate(string s)
{
return s.Equals("sh"); });

//*************If contains the data**********
bool bIsSuccess = m_liName.Contains("sadi");
// output: true
}
}
}

posted on 2011-08-14 23:17  程序诗人  阅读(238)  评论(0编辑  收藏  举报