c# - 在循环内创建列表时,由于其保护级别而无法访问
问题描述
public List<string> output = new List<string>();
List<string> newNumeralSystem(char number) {
string Alph = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
char[]a = new char[25];
a = Alph.ToCharArray();
int ac = Array.IndexOf(a,number);
for(int x = 0; x > 25; x++)
{
int m = ac - x;
if(m != 0)
{
//output[x] = string.Format(a[m] +"+"+ a[x]);
output.Add(new string(){a[m] + "+" + a[x]});
}
}
return output;
}
我不断收到这个
错误 CS0122:
SpanHelpers.Add<T>(IntPtr, int)
由于其保护级别而无法访问
解决方案
推荐阅读
- vba - 运行宏两次导致空白结果并不断出现运行错误
- python-3.x - 结果中的 sqlAlchemy 行数
- asp.net-mvc - .net core 中嵌套模型的自定义验证
- flutter - 如何创建从右侧打开且仅显示其宽度的 80% 的模态底页
- python - 尽管在 Postman 中工作,Python PUT 请求总是返回 401 错误
- ubuntu - VSCode 完全崩溃 Ubuntu 20.04.3 LTS
- mongoose - 我填充了一个 Mongoose 模型,但是当我稍后引用它时它没有填充
- node.js - 反应快递。如何获取 mongodb 数据?
- c# - 尝试调用方法:无法调用 CollisionHandler.NextScene
- qt - Qt QDateTime::fromString 使用 Qt::ISODate 给出不正确的值