这是代码:
var numbers =
lightningsRegions.SelectMany(
s => Regex.Matches(s, @"\[(\d+)[ -]+(\d+)\]")
.Cast<Match>()
.Select(m => m.Groups.Cast<Group>().Skip(1).Select(x => x.Value)
.ToArray())
.Select(x => new { start = int.Parse(x[0]), end = int.Parse(x[1]) })
.SelectMany(x => Enumerable.Range(x.start, x.end - x.start + 1))
)
.ToList();
for (int i = 0; i < list_of_histogramsR.Count ; i++)
{
if (list_of_histogramsR[i] == numbers[i])
{
}
}
我将变量数视为索引数。最后数字包含5372个数字。所以 thr 5272 中的每个数字就像一个索引。
现在我有这个List<long[]> list_of_histogramsR
包含 16595 个索引。我想检查是否有任何数字中的数字list_of_histogramsR
作为索引号然后做一些事情。
例如,数字中的第一个数字是 41。因此,当 list_of_histogramsR == 的索引号 41 到数字中的数字 41 时,做一些事情。然后对于变量编号中的下一个数字也是如此。
问题是在 IF 行我得到错误:错误 33 运算符'=='不能应用于'long []'和'int'类型的操作数
为什么 ?