What is List<List<string>> and how do I get the data out (as Strings)?
It's a list of lists of strings. Each element of the "outer" list is a list of strings. The simplest way to "flatten" the list is to use LINQ:
var flattened = listOfLists.SelectMany(list => list);
foreach (var value in flattened)
{
Console.WriteLine(value);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With