Find a Key
The ContainsKey method checks if a key is already exists in the SortedDictionary.
The following code snippet checks if a key is already exits and if not, add
one.
if (!AuthorList.ContainsKey("Mahesh Chand"))
{
AuthorList["Mahesh Chand"] = 20;
}
Learn more:

Join the conversation! Your thoughts help the community grow.