xxxxxxxxxx
var intArray = new[] { 1, 2, 3, 4, 5 };
var list = new List<int>(intArray);
xxxxxxxxxx
/// <summary>
/// Convert List of string to Array
/// </summary>
/// <param name="lst"></param>
/// <returns></returns>
public static Array ConvertListToArray(List<string> lst)
{
string[] arr = lst.ToArray();
return arr;
}
xxxxxxxxxx
string[] stringArray = { "Hello", "world", "!" };
List<string> stringList = stringArray.ToList();