Basically, object initializer expressions do not support indexing in C # 5 (which supports VS2013). This is a new feature in C # 6.
In C # 6, your code is equivalent:
StringBuilder tmp = new StringBuilder();
tmp[0] = 'T';
StringBuilder s = tmp;
There is no equivalent to a single expression in C # 5, although of course you can just use new StringBuilder("T")to achieve the same result ...
Dictionary<,> - , " ", Add:
var dict = new Dictionary<string, int>
{
{ "key1", 10 },
{ "key2", 20 }
};
, :
var dict = new Dictionary<string, int>
{
["key1"] = 10,
["key2"] = 20
};
... , , , Dictionary<,>... Add . , , Add , .
, , , () Add. , , .
# 6 . Roslyn Codeplex.