Hello everyone,
I'm facing some difficulties in selecting entries in a dictionary,
based on their starting letter. In the below dictionary, for example,
the two entries start with a different letter, but the second string
element in the list starts with "Aa", which is actually equivelent to
the danish letter "Å", the starting letter of the first string. Does
anyone have a notion how I could modify the below, so that both items
would be selected, and resultcount would be 2?
Dictionary<int, string> testDictionary = new Dictionary<int, string>
();
testDictionary.Add(1, "Ålborg");
testDictionary.Add(2, "Aalborg");
var query = from foo in testDictionary
where foo.Value.StartsWith("Å", StringComparison.CurrentCulture)
select foo;
int resultcount = query.Count();
Right now I'm going about it rather manually, but it would make for
much nicer code if the above could be made to work.
Thank you in advance,
Morten