Welcome...



...All those moments will be lost in time, like tears in rain....

- soliloquy from Blade Runner


Bits and bytes do get lost, awash in the rain of data flow that is Internet. They slip away from us, never to found again... some of them will be captured here, many more will not... like tears in rain...



Friday, May 1, 2015

Removing item from dictionary in C#

  There is a method aptly named Remove:

  public bool Remove
  (
 TKey key
  )

  dict.Remove(keyId)

 It will not raise the exception if key does not exist -  handy!

  If you do want to check existence of the key anyways, it will return false if it  is unable to find a key (or unable to remove it for some other odd reason).

No comments:

Post a Comment