Hashtable, key-value-pair (string)

  • Thread starter Thread starter oliver.wulff
  • Start date Start date
O

oliver.wulff

Does there exist a class similar to a hashtable which provides a key-value
pair collection. The key and the value has to be a string?
 
Oliver,
System.Collections.Specialized.StringDictionary is a HashTable where the key
& value are string.

System.Collections.Specialized.NameValueCollection is an ordered HashTable
where the key & value are string.

Both System.Collections & System.Collections.Specialized have other
collection classes and base collection classes that you can use or use to
build your own collections.

Hope this helps
Jay
 
Hi,

take a look at:
System.Collections.Specialized.HybridDictionary

Keys and Values are both objects. But all in DotNET is an object. So you can
pass a string in it.

cu
Bjoern Wolfgardt
 
Hi,

it is a specialized class. You don't have to care about how big the
collection will become. It will switch to ListDictonary if the Collection is
small and if it becomes bigger it will switch to Hashtable.
But I didn't remember that there is a collection that uses strings as values
and keys. So look at Jays answer.

cu
Bjoern Wolfgardt



What's the difference between the class Hashtable and
System.Collections.Specialized.HybridDictionary? Both use objects for key's
and value's.
 
Back
Top