Collection Classes in .net - the StringDictionary
This is the eleventh part of an article on collection classes in .net with C#. This part covers the StringDictionary.
For the first part see http://www.audacs.co.uk/ViewPage.aspx?PageID=512
For the next part on the HybridDictionary see http://www.audacs.co.uk/ViewPage.aspx?PageID=525
This appears to be just a regular hashtable but strongly typed to work with strings rather than objects. It must therefore be pre generics.
Most people seem to be of the oppinion that we should now use the generic dictionary where possible and only use this for legacy code.
For legacy and historical purposes though we will have a quick code exmample.
The class can be found at:
And here is a sample program and output:
You will probably have noticed that the keys have been changed to lower case. This is by design even though it could obviously catch you out or cause problems.
See this thread for more info on this.
http://haacked.com/archive/2004/06/25/685.aspx
So thats about it for the StringDictionary.
For the next part on the HybridDictionary see http://www.audacs.co.uk/ViewPage.aspx?PageID=525