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