首页 > 其他 > 详细

委托的匿名方法

时间:2018-11-10 16:37:52      阅读:143      评论:0      收藏:0      [点我收藏+]
 1     class Program
 2     {
 3         static void Main(string[] args)
 4         {
 5             List<string> list = new List<string>() { "abf", "cde", "def" };
 6             List<string> resultList = list.FindAll(
 7                     delegate(string s)
 8                     {
 9                         return s.IndexOf(f) >= 0;
10                     }
11             );
12             string[] resulStrings = resultList.ToArray();
13             foreach (var s in resulStrings)
14             {
15                 Console.WriteLine(s);
16             }
17 
18         }
19        
20     }

 

委托的匿名方法

原文:https://www.cnblogs.com/myBlogOu/p/9939607.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!