Case insensitive System.Collections.Generic.Dictionary

P

pamela fluente

Hi

I am doing something like:

Dim MiDict As New System.Collections.Generic.Dictionary(Of String,
MyObject)

how should I change the above so that the string comparison (key) is
done using the case insensitive comparer ?

Thanks you

-Pam
 
P

pamela fluente

Pamala,
Dim MiDict As New System.Collections.Generic.Dictionary(Of String,
MyObject)(StringComparer.CurrentCultureIgnoreCase)

StringComparer has shared properties both case sensitive & case insensitive
comparisons for the current culture, the invariant culture and ordinal

http://msdn2.microsoft.com/en-us/library/system.stringcomparer.aspx

Thank you Jay,

just what I needed.

ciao,
--
Hope this helps
Jay B. Harlow [MVP - Outlook]
.NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley -http://www.tsbradley.net




I am doing something like:
Dim MiDict As New System.Collections.Generic.Dictionary(Of String,
MyObject)
how should I change the above so that the string comparison (key) is
done using the case insensitive comparer ?
Thanks you
-Pam- Nascondi testo tra virgolette -

- Mostra testo tra virgolette -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top