我有这个代码:
private readonly string[,] sSOMETHING = new string[,]
{
{"ONE", "TWO", "THREE"},
{"FOUR", "FIVE", "SIX"}
};
...
foreach (string[] sELSE in sSOMETHING)
{
...
}
当很明显 sSOMETHING 是一个数组时,我在 foreach 中收到一个错误,它无法将字符串转换为字符串 []。为什么它不将字符串数组识别为数组?foreach 多维数组有问题吗?