' hashset.vb Imports System Imports System.Collections.Generic Class Program Shared Sub Main() Dim lincoln As String = "government of the people by the people for the people" ' HashSetクラスによる単語テーブル Dim hsTable As New HashSet(Of String) For Each word As String In lincoln.Split(" ") ' 単語を追加。未登録なら表示 If hsTable.Add(word) Then Console.WriteLine(word) End If Next End Sub End Class ' コンパイル方法:vbc hashset.vb