how to write list c# code example
Example 1: c# writeline list
Console.WriteLine("List of Numbers: {0}",string.Join("",list));
//Output: List of Numbers: 123456789
Console.WriteLine("List of Numbers: {0}",string.Join(",",list));
//Output: List of Numbers: 1,2,3,4,5,6,7,8,9
Example 2: make a list c#
IList<int> newList = new List<int>(){1,2,3,4};