C# list
List<string> myListOfStrings = new List<string>
{
"this",
"is",
"my",
"list"
};
C# list
List<string> myListOfStrings = new List<string>
{
"this",
"is",
"my",
"list"
};
make a list c#
IList<int> newList = new List<int>(){1,2,3,4};
to list c#
var arr = new int[] {1, 2, 3};
List<int> list = arr.ToList();
lists in c#
public class Part : IEquatable<Part>
{
public string PartName { get; set; }
public int PartId { get; set; }
}
public class Example
{
public static void Main()
{
// Create a list of parts.
List<Part> parts = new List<Part>();
// Add parts to the list.
parts.Add(new Part() {PartName="crank arm", PartId=1234});
parts.Add(new Part() { PartName = "chain ring", PartId = 1334 });
//
foreach (Part aPart in parts)
Console.WriteLine(aPart);
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us