로딩
요청 처리 중입니다...

C# - List 중복제거 방법

 C# - List 중복제거 방법

C# List 중복 제거 방법은 다음과 같다. List newlist = list.Distinct().ToList(); 아래는 코드 예시이다.

List numbers = new List { 1, 2, 3, 3, 4, 5, 5 }; // 입력 : [1, 2, 3, 3, 4, 5, 5] numbers = numbers.Distinct().ToList(); // 결과 : [1, 2, 3, 4, 5] C#의 List 컬렉션의 중복을 제거하는 방법은 Distinct().ToList()이 가장 일반적인 방법이다냥 namespace CSharpTest { public class Program { public static void Main(string[] args) { List numberList = new List { 1, 2, 3, 3, 4, 5, 5 }; numberList = numberList.Distinct().ToList(); fore...

# CSharp # C샵 # Distunct # HashSet # List # List중복 # List중복제거 # 중복