VOOZH about

URL: https://www.geeksforgeeks.org/c-sharp/c-sharp-dictionary-values-property/

⇱ C# | Dictionary.Values Property - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

C# | Dictionary.Values Property

Last Updated : 11 Jul, 2025
This property is used to get a collection containing the values in the Dictionary<TKey,TValue>. Syntax:
public System.Collections.Generic.Dictionary<TKey, TValue>.KeyCollection Values{ get; }
Return Value: This property returns a collection containing the Values in the Dictionary. Below are the programs to illustrate the use of Dictionary<TKey,TValue>.Values Property: Example 1:
Output:
Total key/value pairs in myDict are : 6
Value = Canberra
Value = Brussels
Value = Amsterdam
Value = Beijing
Value = Moscow
Value = New Delhi
Example 2:
Output:
Total key/value pairs in myDict are : 4
Values = 8
Values = 4
Values = 7
Values = 7
Reference:
Comment

Explore