void Main()
{
var dictionary = new Dictionary<int, string>
{
{1, "one"},
{2, "two"},
{3, "three"},
{4, "four"},
{5, "five"},
};
var number = dictionary.GetValueOrDefault(2);
number.Dump(); // returns 2
dictionary[6] = "six";
number = dictionary[6].Dump(); // returns 6
}
// You can define other methods, fields, classes and namespaces here
Dictionary code
- Details
- Written by: Super User
- Category: Programmeren
- Hits: 184