【发布时间】: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<int, string>?
标签: c#