471,123 Members | 873 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,123 software developers and data experts.

StringDictionary vs Dictionary<>

Hi

are there any benefits in using StringDictionary over Dictionary<string,
string?

It appears they achieve the same thing... (I could be wrong of course).
thanks,
Peter
May 24 '07 #1
4 10473
On May 24, 10:31 am, Peter K <xdz...@hotmail.comwrote:
are there any benefits in using StringDictionary over Dictionary<string,
string?

It appears they achieve the same thing... (I could be wrong of course).
The only benefit would be that you could compile your code in .NET
1.1, which didn't have generics (and thus didn't have
Dictionary<TKey,TValue>).

Jon

May 24 '07 #2
"Peter K" <xd****@hotmail.comwrote in message
news:e0**************@TK2MSFTNGP06.phx.gbl...
are there any benefits in using StringDictionary over Dictionary<string,
string?
Not in my opinion - in fact...
It appears they achieve the same thing... (I could be wrong of course).
....you need to be *very* careful with StringDictionary:
http://forums.microsoft.com/MSDN/Sho...05992&SiteID=1

If you're running v2, I would advise you not use StringDictionary at all...
--
http://www.markrae.net

May 24 '07 #3
"Peter K" <xd****@hotmail.comschrieb im Newsbeitrag
news:e0**************@TK2MSFTNGP06.phx.gbl...
Hi

are there any benefits in using StringDictionary over Dictionary<string,
string?
StringDictionary compares the keys always case insensitive by converting any
string to lower case before use.
This may be disirable or not.

Christof
May 24 '07 #4
On May 24, 11:06 am, "Christof Nordiek" <c...@nospam.dewrote:
are there any benefits in using StringDictionary over Dictionary<string,
string?

StringDictionary compares the keys always case insensitive by converting any
string to lower case before use.
This may be disirable or not.
One alternative for Dictionary<to achieve the case insensitivity but
preserving the case of the keys themselves is to specify the
IEqualityComparer to use.

The MSDN docs for Dictionary<TKey,TValue>(IEqualityComparer<TKey>) has
this has an example.

Jon

May 24 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Brian P | last post: by
1 post views Thread by Eran | last post: by
7 posts views Thread by Andrew Robinson | last post: by
4 posts views Thread by Mark S. | last post: by
8 posts views Thread by Peter Larsen [CPH] | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.