List1: List2: SNo. Address SNo. Address 1 AAAAA 1 BBBBB 2 BBBBB 2 CCCCC 3 CCCCC 3 DDDDD Expected Results: SNo Address 1. AAAAA -----> This row is define Red color,(Because not in List2) 2. BBBBB -----> This row is define Green color(Because it contains both Lists) 3. CCCCC -----> This row is define Green color(Because it contains both Lists) 4. DDDDD -----> This row is define Blue color(Because not in List1)
var onlyinfirst = from s in list1 where !list2.Contains(s) select s; var onlyinsecond = from s in list2 where !list1.Contains(s) select s; var onboth = from s in list1 where list2.Contains(s) select s;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)