Delete key from Dictionary (C# 2.0)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?THVpZ2k=?=

    Delete key from Dictionary (C# 2.0)

    Hi all,
    I have a dictionary like this:

    Dictionary<stri ng, Objects>

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

    Thanks in advance.
    --
    Luigi

  • Hans Kesting

    #2
    Re: Delete key from Dictionary (C# 2.0)

    It happens that Luigi formulated :
    Hi all,
    I have a dictionary like this:
    >
    Dictionary<stri ng, Objects>
    >
    How can I remove a key - and the associated values - from a dictionary?
    >
    Thanks in advance.
    var dict = new Dictionary<stri ng, object>();
    // ...
    dict.Remove("th eKeyToRemove");


    Hans Kesting


    Comment

    • Peter Morris

      #3
      Re: Delete key from Dictionary (C# 2.0)

      Google for
      C# dictionary msdn

      first hit, then look at the methods.



      --
      Pete
      ====


      Comment

      Working...