Dictionary<string, T>では、コンストラクタでキーの比較を行うためのIEqualityComparer<string>を指定することが出来るため、StringComparerを指定することでキーの大文字小文字を無視するディクショナリを作成することも出来ます。
StringComparerを指定してキーの大文字と小文字の違いを無視する・無視しないDictionaryを作成する
Imports System
Imports System.Collections.Generic
Class Sample
Shared Sub Main()
Dim dict1 As New Dictionary(Of String, String)(StringComparer.InvariantCulture)
Dim dict2 As New Dictionary(Of String, String)(StringComparer.InvariantCultureIgnoreCase)
dict1("foo") = "bar"
dict1("Foo") = "Bar"
dict1("FOO") = "BAR"
dict2("foo") = "bar"
dict2("Foo") = "Bar"
dict2("FOO") = "BAR"
Console.WriteLine("dict1")
For Each p As KeyValuePair(Of String, String) In dict1
Console.WriteLine("{0} = {1}", p.Key, p.Value)
Next
Console.WriteLine("dict2")
For Each p As KeyValuePair(Of String, String) In dict2
Console.WriteLine("{0} = {1}", p.Key, p.Value)
Next
End Sub
End Class
実行結果
dict1 foo = bar Foo = Bar FOO = BAR dict2 foo = BAR