動くコード図鑑技術記事現場の渡り方キャリア論すべての記事About
C#

パターン3: HashSet<T> ──大量データ・重複検知に使う

出典: C# でリストの重複を一意にする3つの書き方(Distinct / GroupBy / HashSet)パターン3: HashSet<T> ──大量データ・重複検知に使う

パターン3: HashSet<T> ──大量データ・重複検知に使う (csharp)#e2a378f37c27
var emails = new List<string> { "Foo@example.com", "foo@example.com", "Bar@example.com" };
var unique = new HashSet<string>(emails, StringComparer.OrdinalIgnoreCase).ToList();
//結果: ["Foo@example.com", "Bar@example.com"]
▸ この snippet は実行結果未収録
▸ 実行結果は未収録です
  • id: #e2a378f37c27
  • lines: 3
  • extracted: 2026-06-10

Source収録記事

この snippet は記事の「パターン3: HashSet<T> ──大量データ・重複検知に使う」セクションに登場する。コードの前後の文脈・ハマりどころの解説は記事本文で。

同じ記事から

10
図鑑トップ