我有這樣一個名單,C#刪除重複的邏輯
COL1 COL2 COL3
---- ---- -----
AA AB Some text
AA AC Some text
AA AB Some text
AB AB Some text
AB AC Some text
AA AC Some text
我期待在C#中(也許在+ LINQ)一個快速,高效的邏輯去除這兩列重複(COL1,COL2) (同樣喜歡刪除重複在Excel)
最終結果應該是
AA AB Some text
AA AC Some text
AB AB Some text
AB AC Some text
請指點
您需要顯示列如何以對象的形式存儲在內存中。很可能你會使用LINQ Distinct擴展。 – pickypg 2011-05-12 04:02:08
這些數據的數據結構是什麼?兩個清單?如果是這樣,LINQ中的'.Distinct()'擴展將成爲你的方法。 – Tejs 2011-05-12 04:02:19
我如何.Distinct()只適用於COL1,COL2? – kakopappa 2011-05-12 04:04:17