Reputation: 63
I have a list as follows,
List<string> variablelist = new List<string> { "first", "second","third"};
And i have one more list, like
List<string> method = new List<string>();
//somecode
method.Add(workingline);
I want to check if any of the element of variablelist
is NOT present in method
list and also I want get that Particular ELEMENT.
Thanks in Advance
Upvotes: 1
Views: 692
Reputation: 391
this should be another solution to it.
var list = variablelist.Where(ItemName => !method.Contains(ItemName)).ToList();
Upvotes: 0