Iterate a Dictionary - best way


i using following way iterate dictionary

  foreach(keyvaluepair<string,string> entry in dict)    {            }  
there other ways iterate?

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

Popular posts from this blog

SQL Server 2008 - High Memory Usage

Problem In Configuring Biztalk 2009 In Creating A ReceivePort.When I Try To Create A Receive POrt I Got This Error

BizTalk Server 2013 Azure VM Log Shipping and HA for hosts