I'm trying to find string in dictionary with pair values to find its integer value. Important to find through the string and then get its integer, not vice-versa. 1000 strings list "string" and integer:
Dictionary<string, int> Dict = new Dictionary<string, int>();
and now I want find specific string, some input, which is exist in Dict:
string findStr = "hello world";
This way I got all strings which start with "hello...":
var result = Dict.Where(pair => pair.Key.StartsWith(findStr) && pair.Value > 0);
and this way just nothing:
var result = Dict.Where(pair => pair.Key.Equals(findStr) && pair.Value > 0);
I'm not sure how to go further to get desired result:
To find equal string in my Dictionary and get its pair integer value.