2018年8月14日 星期二

C# 小撇步

C# 6.0 dictionary 初始化的新寫法

var dict = new Dictionary<string, int>
{
    ["one"] = 1,
    ["two"] = 2,
    ["three"] = 3
};