Home
Name Modified Size InfoDownloads / Week
NameValueCollection.cs 2022-02-08 30.0 kB
ReadMe.md 2022-01-26 880 Bytes
License.txt 2022-01-26 1.1 kB
Totals: 3 Items   32.0 kB 0

NameValueCollection

Represents a generic implementation of NameValueCollection - a generic collection of associated string keys and given type values that can be accessed either with the key or with the index.
It is a collection that is similar to a Dictionary but NameValueCollection can have duplicate keys while Dictionary cannot. Elements can be obtained both by index and by key.
What makes this collection special, is that one key can contain several elements.

Usage

NameValueCollection<int> collection = new NameValueCollection<int>();
collection.Add("a", 123);
collection.Add("a", 456); // 123 and 456 will be inserted into the same key. 
collection.Add("b", 789); // 789 will be inserted into another key.

int[] a = collection.Get("a"); // contains 132 and 456.
int[] b = collection.Get("b"); // contains 789.
Source: ReadMe.md, updated 2022-01-26