c# string to list code example
Example 1: c# list to string
List<string> names = new List<string>() { "John", "Anna", "Monica" };
string result = string.Join(",", names.ToArray());
Example 2: string to list c#
var names = "Brian,Joe,Chris";
List<string> result = names.Split(',').ToList();
Example 3: convert string to list int c#
var numbers = sNumbers.Split(',').Select(Int32.Parse).ToList();