string[] to list C# code example
Example 1: string to list c#
var names = "Brian,Joe,Chris";
List<string> result = names.Split(',').ToList();
Example 2: to list c#
var arr = new int[] {1, 2, 3};
List<int> list = arr.ToList();
var names = "Brian,Joe,Chris";
List<string> result = names.Split(',').ToList();
var arr = new int[] {1, 2, 3};
List<int> list = arr.ToList();