PC Review


Reply
Thread Tools Rate Thread

Case insensitive System.Collections.Generic.Dictionary

 
 
pamela fluente
Guest
Posts: n/a
 
      3rd Feb 2007
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

 
Reply With Quote
 
 
 
 
Jay B. Harlow [MVP - Outlook]
Guest
Posts: n/a
 
      4th Feb 2007
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/lib...gcomparer.aspx

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


"pamela fluente" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>


 
Reply With Quote
 
pamela fluente
Guest
Posts: n/a
 
      4th Feb 2007

On 4 Feb, 16:43, "Jay B. Harlow [MVP - Outlook]"
<Jay_Harlow_...@tsbradley.net> wrote:
> 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/lib...gcomparer.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
>
> "pamela fluente" <pamelaflue...@libero.it> wrote in message
>
> news:(E-Mail Removed)...
>
>
>
> > 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- Nascondi testo tra virgolette -

>
> - Mostra testo tra virgolette -



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Case insensitive generic list search ? hdjim Microsoft C# .NET 12 24th Aug 2010 11:46 PM
Is System.Collections.Generic.dictionary order preserved? Magnus.Moraberg@gmail.com Microsoft C# .NET 4 19th Jun 2008 09:40 AM
Method not found: 'System.Collections.Generic.Dictionary`2 Monty Microsoft ASP .NET 3 6th Nov 2007 06:24 AM
deep copy (Clone) on System.Collections.Generic.Dictionary ? semedao Microsoft C# .NET 3 19th Dec 2006 02:36 PM
Dictionary<K,V> and Case Insensitive key compare? William Stacey [MVP] Microsoft C# .NET 2 10th Aug 2004 07:45 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:29 AM.