これらの関数を呼び出して必要のないものを取り除こうとしていますが、無駄な闘いであると認識し始めていることで、コードが私を打ち負かしているようです。これらの最後の 2 つのエラーを解決するために複数の方法を試しましたが、IEnumerator からワイルド カードが返されます。エラーは行にあります: if (enumerator2 is IDisposable) and if (enumerator is IDisposable)
try
{
enumerator = matchs.GetEnumerator();
while (enumerator.MoveNext())
{
IEnumerator enumerator2;
Match current = (Match) enumerator.Current;
num = 0;
try
{
enumerator2 = current.Groups.GetEnumerator();
while (enumerator2.MoveNext())
{
Group group = (Group) enumerator2.Current;
strArray[num, num3] = group.Value;
num++;
}
}
finally
{
if (enumerator2 is IDisposable)
{
(enumerator2 as IDisposable).Dispose();
}
}
if (num2 < num3)
{
num2 = num3;
}
num3++;
}
}
finally
{
if (enumerator is IDisposable)
{
(enumerator as IDisposable).Dispose();
}
}
strArray[num, 0] = Conversions.ToString((int) (num2 + 1));
return strArray;
}
編集固有のエラー メッセージ: Use of unassigned local variable 'enumerator2'
Use of unassigned local variable 'enumerator'