【问题标题】:declare more variables at once C#一次声明更多变量 C#
【发布时间】:2022-06-14 16:07:12
【问题描述】:

我在想有什么方法可以一次创建更多变量。我尝试在字符串名称中添加一些东西,但我不知道它是否真的可能。 我的意思是这样的

            for (int x = 1;x <= 100;x++) 
        {
            string strx = "something taken from somewhere else"; /*with x being from 1 to 100
                                                                   so I want to have 100 
                                                                   strings in the end */              
        }

我只是不知道如何在字符串名称中添加变化的数字而不是那个“x”

【问题讨论】:

  • Dictionary&lt;int, string&gt;?

标签: c#


猜你喜欢
  • 2017-05-13
  • 1970-01-01
  • 1970-01-01
  • 2022-06-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-01-31
相关资源
最近更新 更多