HybridDictionary.Clear method is used to remove all entries from the HybridDictionary.
public void Clear ();
Below given are some examples to understand the implementation in a better way :
Number of key/value pairs in myDict are : 6 The key/value pairs in myDict are : A --> Apple B --> Banana C --> Cat D --> Dog E --> Elephant F --> Fish Number of key/value pairs in myDict are : 0 The key/value pairs in myDict are :
Number of key/value pairs in myDict are : 5 The key/value pairs in myDict are : I --> first II --> second III --> third IV --> fourth V --> fifth Number of key/value pairs in myDict are : 0 The key/value pairs in myDict are :
- Count is set to zero, and references to other objects from elements of the collection are also released.
- If the collection is already stored in a Hashtable, the collection remains in the Hashtable.
- This method is an O(n) operation, where n is Count.
- C# | Copying the HybridDictionary entries to an Array Instance
- C# | Removing the specified key entry from HybridDictionary
- C# | Removing all entries from the StringDictionary
- C# | Adding the specified key and value into HybridDictionary
- C# | Gets or sets the value in HybridDictionary with specified key
- C# | HybridDictionary Class
- C# | Check if HybridDictionary is read only
- C# | Check the HybridDictionary for a specific key
- How to get Synchronize access to the HybridDictionary in C#
- C# | Get an ICollection containing the values in HybridDictionary
- C# | Get an enumerator that iterates through the HybridDictionary
- C# | Get an ICollection containing the keys in HybridDictionary
- C# | Check if HybridDictionary has fixed size
- C# | Count the number of key/value pairs in HybridDictionary
- C# | Check if two HybridDictionary objects are equal
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.