Lists in C# have the .ToArray() method. I want the inverse, where an array is transformed into a list. I know how to create a list and loop through it but I would like a one liner to swap it back.
.ToArray()
I am using the String.Split method in the .NET 2.0 environment, so LINQ, etc. is not available to me.
String.Split
string s = ... new List<string>(s.Split(....));
2.1m questions
2.1m answers
60 comments
57.0k users