I have a list which contains three items. First element is integer, second one is also an integer and third one is another list. By using for each loop I\'m able to print th
If your first two items in mainList really are fixed then change this
foreach(var i in mainList)
{
Console.WriteLine(i); // Prints items
}
to
Console.WriteLine(mainList.Item[0]);
Console.WriteLine(mainList.Item[1]);
foreach(var i in mainList.Item[2])
{
Console.WriteLine(i); // Prints items
}
Looks pretty ugly to me, though.