Mid Collections

How do you remove a key-value pair from a Dictionary?

Use the Remove(key) method:

dictionary.Remove("key1");

Returns true if the key was found and removed, false otherwise.

More from C# Programming Tutorial

All questions for this course