Updating Dictionary elements while iterating.

As we know we can’t update any collection element if we are iterating them using foreach loop.
For example, we could iterate Dictionary using KeyValuePair in foreach loop but we can’t modify them. But what if we want to iterate the entire dictionary and at the same time also we have a need to modify the Dictionary Elements.

Read more:  http://www.c-sharpcorner.com/Blogs/10905/updating-dictionary-elements-while-iterating.aspx

By Sriramjithendra Posted in C#.NET

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s