I\'am trying to check the difference between two List in c#.
Example:
List FirstList = new List
You can use Enumerable.Intersect:
var inBoth = FirstList.Intersect(SecondList);
or to detect strings which are only in one of both lists, Enumerable.Except:
var inFirstOnly = FirstList.Except(SecondList);
var inSecondOnly = SecondList.Except(FirstList);
To get your ThirdList:
List ThirdList = inSecondOnly.ToList();