How to display list items on console window in C#

后端 未结 7 1288
执笔经年
执笔经年 2020-11-29 00:19

I have a List which contains all databases names. I have to dispaly the items contained in that list in the Console (using Console.WriteLine()). Ho

相关标签:
7条回答
  • 2020-11-29 01:00

    I found this easier to understand:

    List<string> names = new List<string> { "One", "Two", "Three", "Four", "Five" };
            for (int i = 0; i < names.Count; i++)
            {
                Console.WriteLine(names[i]);
            }
    
    0 讨论(0)
提交回复
热议问题