Mega Code Archive

 
Categories / C# / Collections Data Structure
 

To get the values alone, use the Values property

using System; using System.Collections.Generic; public class Example {     public static void Main()     {         Dictionary<string, string> openWith = new Dictionary<string, string>();         openWith.Add("A", "a");         openWith.Add("B", "b");         openWith.Add("C", "c");         Dictionary<string, string>.ValueCollection valueColl = openWith.Values;         foreach( string s in valueColl )         {             Console.WriteLine("Value = {0}", s);         }     } }