instantiate list with values c#

80

instantiate list with values c# -

var list = new List<string> {
  "test1",
  "test2",
  "test3"
};

instantiate list C# -

List<string> mylist = new List<string>(new string[] { "element1", "element2", "element3" });

Comments

Submit
0 Comments