What’s the correct C# syntax to do the following using sexier syntax?
string[] arr = ///....
List<string> lst = new List<string>();
foreach (var i in arr) {
lst.Add(i);
}
I feel like this could be a one liner using something like:
arr.Select(x => lst.Add(x));
but I’m not quite bright enough to figure out the right syntax.
.ToList() is fine, but to be honest, you don’t need LINQ for that: