//.net 1.0写法
            /*delegate bool MyMethod(string s);
             bool myMethod(string s)
            {
                return s.IndexOf("abc") >= 0;
            }
            MyMethod m1 = new MyMethod(myMethod);
            
            List<string> l1 = l.FindAll(m1);
            */

            //.net 2.0 写法
            //List<string> l1 = l.FindAll(delegate(string s) { return s.IndexOf("abc")>=0; });
            //.net 3.0 写法
            List<string> l1 = l.FindAll(s=>s.IndexOf("abc") >=0);

 lambda表达式实际上是委托类型的对象

相关文章:

  • 2021-11-27
  • 2021-05-30
  • 2021-10-15
猜你喜欢
  • 2022-12-23
  • 2021-04-29
  • 2022-01-23
  • 2021-06-10
  • 2021-12-02
  • 2022-12-23
相关资源
相似解决方案