Iterate a Dictionary - best way
i using following way iterate dictionary
foreach(keyvaluepair<string,string> entry in dict) { }
you can use linq - planning "entry" elements?
for example, if wanted values keys started "f", in one-liner using linq:
var matches = dict.where(kvp => kvp.key.startswith("f")).select(kvp => kvp.value);
reed copsey, jr. - http://reedcopsey.com
if post answers question, please click "mark answer" on post , "mark helpful".
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment