Answers for "C# list initializer"

C#
2

c# how to set string list

// This will create a new list called 'nameOfList':
var nameOfList = new List<string> 
{
  "value1",
  "value2",
  "value3"
};
Posted by: Guest on October-28-2020
2

instantiate list with values c#

var list = new List<string> {
  "test1",
  "test2",
  "test3"
};
Posted by: Guest on September-02-2020

C# Answers by Framework

Browse Popular Code Answers by Language