I have a hashtable with 7 keys, and each key contains an array list.
How do I go about iterating through all the values for each key? Thanks.
Printable View
I have a hashtable with 7 keys, and each key contains an array list.
How do I go about iterating through all the values for each key? Thanks.
I was able to figure it out by using dictionary instead of hashtable if anyone else has a similar question
Dictionary<string, ArrayList> dictionary = new Dictionary<string, ArrayList>();
for (int i = 0; i < dictionary["Test"].Count; i++)
{
foreach (KeyValuePair<string, ArrayList> item in dictionary)
{
if (item.Key == "Test")
{
MessageBox.Show(item.Value[i].ToString());
}
}
}