How to check whether Dictionary contains any value or not?

 Posted by Rajesh_Kumar on 1/16/2014 | Category: C# Interview questions | Views: 1687 | Points: 40

With the help of ContainsValue method,we can check whether dictionary has a value or not?

Dictionary<string, string> dict_names = new Dictionary<string, string>();
dict_names.Add("name", "rajesh");

return true;
return false;

It will return true because rajesh is present inside dictionary.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response