how to search dictionary?

///this is my dictionary
public Dictionary slowbombitems = new Dictionary();

public void Addslowbomtodict(string x, GameObject j)
{

slowbombitems.Add(x,j);
}

x is the player

i want to find all the bomb that player1 hold, what should i type?

find every “player1” and destroy the corresponding gameobject

You use .Contains, a dictionary can only have one instance of a key.

“In Dictionary, key must be unique. Duplicate keys are not allowed if you try to use duplicate key then compiler will throw an exception. In Dictionary, you can only store same types of elements.”

So when you use slowbombitems.Add(x,j); you overwrite the value stored at that key.