how to convert a list into array in c# code example
Example 1: c# array to list
var intArray = new[] { 1, 2, 3, 4, 5 };
var list = new List<int>(intArray);
Example 2: C# list to array
string[] array = list.ToArray();
var intArray = new[] { 1, 2, 3, 4, 5 };
var list = new List<int>(intArray);
string[] array = list.ToArray();