Best collection for data in C# .NET -
i have store data:
"al" => 1997 "ak" => 1977 ... "wy" => 1997
what's best way store in .net? shall use arrays, or arraylist, or collection?
try system.collections.generic.dictionary<tkey, tvalue>
.
you use this:
var values = new dictionary<string, int> { { "al", 1997 }, { "ak", 1977 }, ... { "wy", 1997 }, }; console.writeline(values["ak"]); // writes 1977
Comments
Post a Comment