■ HashSet

○ 개념

○ 사용법

  1. 네임스페이스 가져오기
using System.Collections.Generic;
  1. HashSet 생성
HashSet<string> myHashSet = new HashSet<string>();
  1. 데이터 추가
myHashSet.Add("Apple");
myHashSet.Add("Banana");
  1. 데이터 존재 여부 확인
if (myHashSet.Contains("Apple"))
{
    Debug.Log("Apple이 존재합니다.");
}
  1. 데이터 제거
myHashSet.Remove("Banana");
  1. 모든 데이터 삭제
myHashSet.Clear();