In C#, how do you output the contents of a Dictionary class?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: In C#, how do you output the contents of a Dictionary class?

  1. #1
    Join Date
    Dec 2005
    Posts
    180

    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?

  2. #2
    Join Date
    Aug 2012
    Posts
    1

    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
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center