Answers for "verify list exists in another list c#"

1

find element in list not in another list c#

var result = peopleList2.Where(p => !peopleList1.Any(p2 => p2.ID == p.ID));
Posted by: Guest on April-13-2021
0

check list exist in list c# if matches any

List<int> nums1 = new List<int> { 2, 4, 6, 8, 10 };
List<int> nums2 = new List<int> { 1, 3, 6, 9, 12};

if (nums1.Any(x => nums2.Any(y => y == x)))
{
    Console.WriteLine("There are equal elements");
}
else
{
    Console.WriteLine("No Match Found!");
}
Posted by: Guest on November-06-2021

Code answers related to "verify list exists in another list c#"

Browse Popular Code Answers by Language