我有一个清单:
var list = new List<string>();
list.Add("Dog");
list.Add("Cat");
list.Add("Bird");
var list2 = new List<string>();
list2.Add("Dog");
list2.Add("Cat"):
if (list.ContainsAny(list2))
{
Console.Write("At least one of the items in List2 exists in list1)"
}