The NameValueCollection Collection

The NameValueCollection behaves similarly to the StringDictionary collection, but it differs in that NameValueCollection enables accessing items via either the key or the index. The following code snippet provides a brief demonstration:

Dim nv As New NameValueCollectionnv.Add("First string", "Second string")Dim item As String = nv(0)

The Add method also provides an overload accepting another NameValueCollection as an argument.

Get Visual Basic 2015 Unleashed 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.