c# list initialization code example
Example 1: c# how to set string list
// This will create a new list called 'nameOfList':
var nameOfList = new List<string>
{
"value1",
"value2",
"value3"
};
Example 2: instantiate list with values c#
var list = new List<string> {
"test1",
"test2",
"test3"
};
Example 3: initialize list in c#
List<string> optionList = new List<string>
{ "AdditionalCardPersonAdressType", /* rest of elements */ };