Specialized Collections

The System.Collections.Specialized namespace contains a series of collections that either are strongly typed or offer functionality that is not widely required.

Strongly Typed Collections

The strongly typed collections all deal exclusively with strings.

NameObjectCollectionBase and NameValueCollection

The NameObjectCollectionBase class is an abstract class that is based on a Hashtable but that accepts only strings as key types. The only concrete implementation of this class in the collections namespace is NameValueCollection. The NameValueCollection class is derived from NameObjectCollectionBase but can be used to store multiple values for each key. However, both the key and the values must be strings. The most obvious use ...

Get C# for Java Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.