473,424 Members | 1,913 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,424 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 10658
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: ESPNSTI | last post by:
Hi, I'm trying to use a generics dictionary with a key class that implements and needs IComparable<>. However when I attempt to use the dictionary, it doesn't appear to use the IComparable<> to...
8
by: Brian P | last post by:
I want to expose a property of Dictionary<string, MyAbstractClass>. I tried to do it this way: private Dictionary<string, MyChildClass> _dictionary; public Dictionary<string,...
1
by: Eran | last post by:
Hi, I have a huge data structure, which I previosly stored in a Dictionary<int, MyObj> MyObj is relatively small (2 int, 1 DateTime, 1 bool). The dictionary I am using is quite large...
7
by: Andrew Robinson | last post by:
I have a method that needs to return either a Dictionary<k,vor a List<v> depending on input parameters and options to the method. 1. Is there any way to convert from a dictionary to a list...
4
by: Mark S. | last post by:
Hello, I have a series of changing string IDs that are loaded dynamically a couple times a minute. I need to associate each ID with a different static class so later on in the app's lifecycle it...
8
by: Peter Larsen [CPH] | last post by:
Hi, How do i concat two dictionaries aka the following sample: Dictionary<int, stringa; Dictionary<int, stringb; b.Add(a); What is the easiest way to concat two dictionaries ??
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.