Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我不明白这样的行如何抛出和索引超出范围异常(对不起法语异常)。Array.Contains() 应该返回它是否找到,它应该很简单。数组不为空。
请参阅图像以说明情况。
例外实际上来自上一行。 如果您展开堆栈,则应更正突出显示。
数组从0到Count - 1; fields[fields.Count()]是错的。
0
Count - 1
fields[fields.Count()]
上面的行抛出异常。
fields[fields.Count()] =..
它应该是
fields[fields.Count() - 1] =..