i****a 发帖数: 36252 | 1 I am coding in C# .NET 3.5
Let's say I have a List, and an XML file with list if items.
What I want to do is compare the values of the two lists, and get the
difference.
I want two results, 1. items in List but not in XML, 2. items in XML but
not in List.
I can only think of looping through the List against XML, and another loop
for XML against the List.
Is there another way to do this quicker?
Also, I've been using Xml.Ling to process the XML on other parts of the
program and wonder if Ling offers anything I can use for this. | s***o 发帖数: 2191 | 2 maybe you can use Enumerable.Except method. for more details, check:
http://msdn.microsoft.com/en-us/library/bb300779.aspx
【在 i****a 的大作中提到】 : I am coding in C# .NET 3.5 : Let's say I have a List, and an XML file with list if items. : What I want to do is compare the values of the two lists, and get the : difference. : I want two results, 1. items in List but not in XML, 2. items in XML but : not in List. : I can only think of looping through the List against XML, and another loop : for XML against the List. : Is there another way to do this quicker? : Also, I've been using Xml.Ling to process the XML on other parts of the
| i****a 发帖数: 36252 | 3 alright thanks
【在 s***o 的大作中提到】 : maybe you can use Enumerable.Except method. for more details, check: : http://msdn.microsoft.com/en-us/library/bb300779.aspx
|
|