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