public class UnitTest1 { [Fact] public void Test1() { var list_A = new List<string> { "MU", "CA", "PA" }; var list_B = new List<string> { "A000MU-100002", "A000CB-100004", "A000GU-100006" }; var result = list_B.Where(q => ListTypeFilter(q, list_A)); var temp = result.ToList(); } static bool ListTypeFilter(string hand, List<string> filters) => filters.Any(filter => hand.Contains(filter)); }
标签:c#,List,Contains,list,var,result,集合 From: https://www.cnblogs.com/hofmann/p/17493499.html