Working with Dictionaries

  • myCount = myDictionary.Count [returns the number of key-value pairs]
  • myKeys = myDictionary.Keys [returns a collection of all dictionary keys]
  • myValues = myDictionary.Values [returns a collection of all dictionary values]
  • Clear() [removes all key-value pairs from the dictionary]
  • ContainsValue(2345) [checks if dictionary contains value 2345 and returns true/false]
  • TryGetValue("V12", value) [tries to get value of key "V12" and returns true/false]
  • TryAdd("V13", 3456) [tries to add the key-value pair "V13" : 3456 and returns true/false]
Was this article helpful?
0 out of 0 found this helpful