I think you want to use a typical typed dictionary, not a Hashtable:
Dictionary<String, String[]> ht = new Dictionary<string, string[]>(); ht["LSN"] = new string[5] { "MATH", "PHIS", "CHEM", "GEOM", "BIO" }; ht["WEEK"] = new string[7] { "MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN" }; ht["GRP"] = new string[5] { "10A", "10B", "10C", "10D", "10E" }; string s = ht["LSN"][0];
This should compile fine.
Otherwise, you need to do a listing, for example:
string s = ( ht[ "LSN" ] as string[] )[ 0 ];
Nick
source share