In C#, is there an inline shortcut to instantiate a List with only one item.
I\'m currently doing:
new List( new string[] { \"
Simply use this:
List list = new List() { "single value" };
You can even omit the () braces:
List list = new List { "single value" };
Update: of course this also works for more than one entry:
List list = new List { "value1", "value2", ... };