Congratulations to all monthly winners of May 2013 !!! They have won INR 2900 cash and INR 27497 worth prize.
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 16117 |  Welcome, Guest!   Register  Login
 Home > Forums > C# > How To Modify An Element in the Dictionary Class? ...
Zhang Jingchu

How To Modify An Element in the Dictionary Class?

Replies: 0 | Posted by: Zhang Jingchu on 8/18/2012 | Category: C# Forums | Views: 261 | Status: [Member] | Points: 10  


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);


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

  No reply found.


Reply - Please login to reply


Click here to login & reply

Found interesting? Add this to:


 Latest Posts

Write New Post | More ...

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 6/18/2013 2:05:19 AM