Delete key from Dictionary (C# 2.0)

  • Thread starter Thread starter Luigi
  • Start date Start date
L

Luigi

Hi all,
I have a dictionary like this:

Dictionary<string, Objects>

How can I remove a key - and the associated values - from a dictionary?

Thanks in advance.
 
It happens that Luigi formulated :
Hi all,
I have a dictionary like this:

Dictionary<string, Objects>

How can I remove a key - and the associated values - from a dictionary?

Thanks in advance.

var dict = new Dictionary<string, object>();
// ...
dict.Remove("theKeyToRemove");


Hans Kesting
 
Back
Top