我需要这样的东西:
string a = "12345"
if (a[5] == null) {
//skip error and continue the cycle
}所以问题是,如何忽略这种类型的错误?
发布于 2021-10-06 22:50:15
进行额外的长度检查,如下所示:
if (a.Length >= 6 && a[5] == null) {}但我想你的意思是更像这样:
if (a.Length >= 6 && a[5] == char.MinValue) {}字符不能为空。它可以是'\0',接近于"null“。
问候
https://stackoverflow.com/questions/69473487
复制相似问题