Return number of matches from c# dictionary
Posted
by Rickard Haake
on Stack Overflow
See other posts from Stack Overflow
or by Rickard Haake
Published on 2010-05-26T11:43:44Z
Indexed on
2010/05/26
11:51 UTC
Read the original article
Hit count: 449
c#
|collections
Hello!
I have a dictionary with non unique values and I want to count the matches of a string versus the values.
Basically I now do dict.ContainsValue(a) to get a bool telling me if the string a exists in dict, but I want to know not only if it exists but how many times it exists (and maybee even get a list of the keys it exists bound to)
Is there a way to do this using dictionary, or should I look for a different collection?
/Rickard Haake
© Stack Overflow or respective owner