สร้างรายการ c#
using System.Collections.Generic
//type is your data type (Ej. int, string, double, bool...)
List<type> newList = new List<type>();
ทำให้รายชื่อซี#
IList<int> newList = new List<int>(){1,2,3,4};
c คมรายการของใช้เส้นสาย
// Create a list of strings using 'new List<string>{}'
List<string> stringList = new List<string>{"string1", "string2"};
c#บางครั้งฉันรู้สึกว่าต้องตั้งค่าข้อความรายการ
// This will create a new list called 'nameOfList':
var nameOfList = new List<string>
{
"value1",
"value2",
"value3"
};