VB.NET and linQ: How to delete entries from a dictionary using the value

Posted by user350233 on Stack Overflow See other posts from Stack Overflow or by user350233
Published on 2010-06-07T19:38:54Z Indexed on 2010/06/07 19:42 UTC
Read the original article Hit count: 154

Filed under:
|

I have a dictionary collection as bleow:

mydic.addvalue(key1, val1)
mydic.addvalue(key2, val1)
mydic.addvalue(key3, val1)
mydic.addvalue(key4, val2)
mydic.addvalue(key5, val2)

From the above dictionary I want to delete all the entries where value == "val1", so that the result would have only following entry:

mydic.addvalue(key4, val2)
mydic.addvalue(key5, val2)

My VB source code is on VS2008 and targeted for 3.5

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about LINQ