How to remove an item of a SortedDictionary using C#

Remove Items

The Remove method removes an item with the specified key from the collection. The following code snippet removes an item.

// Remove item with key = 'Mahesh Chand'

AuthorList.Remove("Mahesh Chand");

 

The Clear method removes all items from the collection. The following code snippet removes all items by calling the Clear method.

// Remove all items

AuthorList.Clear(); 


Learn more:

Working with SortedDictionary using C#


Similar Articles