|
-
August 22nd, 2012, 08:48 PM
#1
In C#, how do you output the contents of a Dictionary class?
In C#, how do you output the contents of a Dictionary class?
Once you have loaded a Dictionary class with keys and values, how do I cycle through them and output the individual values in a foreach loop?
-
August 23rd, 2012, 08:32 AM
#2
Re: In C#, how do you output the contents of a Dictionary class?
A Dictionaty object has a propery called Keys.
so go like this
Code:
var dic = new Dictionaty<string, string>();
foreach (var key in dic.Keys) {
Console.WriteLine(key);
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|