Dictionary<> is very cool

Published Mon, Aug 9 2004 18:03 | girishb
Do you know that you can do Dictionary.TryGetValue()? How many times have you not written something like
 
if (blah.ContainsKey(x)) {
 y = blah[x];..whatever
}
 
Now, you can do this with TryGetValue(). It combines both of these functionalities and responds with an [out].