Alex
Alex

Reputation: 2111

List or Array with a text as its Index?

Using vb.net, is it possible to have a list of values such as:

Green
Black
Blue

and the index to be a text value such as

Table
Desk
Chair

something like this

ListColors("Chair")="Green"
ListColors("Desk")="Blue"
ListColors("Table")="Black"

Upvotes: 0

Views: 162

Answers (1)

ThiefMaster
ThiefMaster

Reputation: 318808

Use a Dictionary(Of String, String) object: http://msdn.microsoft.com/en-us/library/xfhwa508.aspx

Upvotes: 6

Related Questions