본문 바로가기
개발/코드

c#) 배열에서 배열을 중복 제거하기

by 테샤르 2022. 7. 27.

배열에서 배열을 중복 제거하기

 

int 배열 a에서 int 배열의 b 항목을 제거하는 코드

 

반응형
using System;
using System.Linq;

public static int[] ArrayDiff(int[] a, int[] b)
  {
    return a.Where(n => !b.Contains(n)).ToArray();
  }

 

 

 

★☆☆☆☆

 

반응형

댓글