Property and Method

Count 집합에 원소의 개수를 출력
Add(Value) 집합에 값을 추가
Remove(Value) 집합에서 값을 제거(값이 없는 경우 아무일도 발생하지 않음)
Contains(Value) 집합에 특정 요소가 있는지 확인
Clear() 리스트에 모든 값을 제거

‘System.Collections.Generic’

using System.Collections.Generic

HashSet Declaration

HashSet<int> set = new HashSet<int>();

HashSet.Add(Value)

set.Add(4);

HashSet.Remove(Value)

set.Remove(3);