Click here to Skip to main content
Click here to Skip to main content
Alternative Tip

Tagged as

Go to top

Diff two lists

, 21 Dec 2010
Rate this:
Please Sign up or sign in to vote.
How about using Linq to find the common items in a list?List listOne = new List{"a", "b", "c", "d"};List listTwo = new List { "d", "e", "f", "g" };List listCommon= listOne.Intersect(listTwo).ToList();
How about using Linq to find the common items in a list?
 
List<String> listOne = new List<string>{"a", "b", "c", "d"};
List<String> listTwo = new List<string> { "d", "e", "f", "g" };
List<String> listCommon= listOne.Intersect(listTwo).ToList();

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

torken2
Software Developer (Senior) realdolmen
Belgium Belgium
No Biography provided

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Mobile
Web02 | 2.8.140916.1 | Last Updated 21 Dec 2010
Article Copyright 2010 by torken2
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid