프로그래밍/C#

C# 두개의 List에 대해 중복 제거(Distinct)

bluecandyg 2014. 8. 5. 20:59



두개의 List를 간단하게 중복 제거 하는 방법


------------------------------------------------

 // 중복 제거

 List<String> lDownloadList_v1 = new List<String>();

 List<String> lDownloadList_v2 = new List<String>();


 lDownloadList_v1.Concat(lDownloadList_v2).Distinct(); -> 잘 안되는것같음(X)


lDownloadList_v1  = lDownloadList_v1 .Except(lDownloadList_v2 ).ToList(); -> 아주 잘 됨(O)

------------------------------------------------