The Artima Developer Community
Sponsored Link

C# Answers Forum
How To Modify An Element in the Dictionary Class?

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
William Thompson

Posts: 11
Nickname: xarzu
Registered: Nov, 2007

How To Modify An Element in the Dictionary Class? Posted: Aug 18, 2012 10:15 PM
Reply to this message Reply
Advertisement
How To Modify An Element in the Dictionary Class?
=======================================

C# has this cool Dictionary class that you can use like a Hash Table. Is there a way of changing the value of an indexed element without resorting to removing it like this?

int value = runningcount[city];
runningcount.Remove(city);
runningcount.Add(city, ++value);

Topic: How do I expose the LoadCompleted method in the WebBrowser class in WPF C#? Previous Topic   Next Topic Topic: looking for third party spell checking + dictionary software

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use