I have a case insensitive dictionary in asp.net/vb.net like this:
Dim caseInsensitiveDictionary = New Dictionary(Of String, Single)(StringComparer.OrdinalIgnoreCase)
it holds values like this
one hundred, 100
one hundred one, 101
one hundred two, 102
I want that if a user tries to find a value like this:
Response.Write(dictionary("ONE-hundred").ToString)
he gets 100 but right now it gets exception because dictionary keys don’t have hyphon ‘-‘. Which method do i need to override.
please suggest
You could either add
ONE-hundred,100as well to the dictionary(the easiest approach) or build a customStringComparer:testing