Click here to Skip to main content
12,360,037 members (61,103 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

1.8K views
1 bookmarked
Posted

Diff two lists

, 21 Dec 2010 CPOL
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

You may also be interested in...

Comments and Discussions

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