using System.Collections;
using System.Collections.Generic;
public static void ConsoleWrite(IEnumerable source)
foreach (var item in source)
else if (item is IEnumerable enumerable)
ConsoleWrite(enumerable);
public static void Main(string[] args)
var list = new List<string>{"1", "2", "3"};
var list2 = new List<List<string>>{new List<string>()
{"4", "5", "6"}, new List<string>()