I have two list, I want the values of list 1 if it contains any of value from list 2.
List<string> list1 = new List<string>();
list1.Add("Sunday is far away");
list1.Add("Today is Monday");
list1.Add("Tuesday is too near");
List<string> list2 = new List<string>();
list2.Add("Sunday");
list2.Add("Monday");
list2.Add("Tuesday");
var result1 = list1.Where(x => list2.Any(y => y.Contains(x))).ToList(); //no results
var result2 = list2.Where(x => list1.Any(y => y.Contains(x))).ToList(); //give values of list2. But I need values of list1
Update:
I need values of list1 in result, how can I get that?
Any(y => x.Contains(y))