Here is the source code to get difference between two string lists
protected void check()
{
List<string> l1 = new List<string>();
List<string> l2 = new List<string>();
l1.Add("Maths");
l1.Add("Biology");
l2.Add("Physic");
l2.Add("Maths");
l2.Add("Biology");
l2.Add("Chemistry");
List<string> diff = l2.Except(l1).ToList();
for (int i = 0; i < diff.Count; i++)
{
Response.Write(diff[i].ToString()+"</br>");
}
}
I have the following result
Physic
Chemistry
Hope this helps!
Sunday, December 4, 2011
How to get the difference between two string lists
8:37 PM
Unknown
No comments
0 comments:
Post a Comment