about StringDictionary

C

C# newbie

Hi,

How can I grab to a specific element value into a string dicitionary ?
Let's say we have an string dictionary which is full and on a specific row
want to grab one of the item.
I found "ContainsKey" method but when I write (within a foreach loop):

if (myStringDicArray.ContainsKey("ControlID"))

it's just returns true or false! I need to return the value in that specific
element.

Thanks in advance
 
J

Jon Skeet [C# MVP]

C# newbie said:
How can I grab to a specific element value into a string dicitionary ?
Let's say we have an string dictionary which is full and on a specific row
want to grab one of the item.
I found "ContainsKey" method but when I write (within a foreach loop):

if (myStringDicArray.ContainsKey("ControlID"))

it's just returns true or false! I need to return the value in that specific
element.

Same as with Hashtable:

string value = myStringDicArray["ControlID"];
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top