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# Linq Contains 字符串集合中是否包含某集合中字符
最新推荐文章于 2023-07-06 14:20:46 发布