Mar*_*hal 3 c# arrays indexing winforms
嗨,有一种方法可以检查C#中特定数字的特定整数数组索引; 例如,我希望工作的将是:
if(si[6] || si[7] || si[8] == 3)
{
MessageBox.Show("3 detected")
}
else
{
continue();
{
Run Code Online (Sandbox Code Playgroud)
显然这不起作用.有干净的方法吗?谢谢你的期待.
tuk*_*aef 10
var indexes = new int[] {6, 7, 8};
if (indexes.Any(i => si[i] == 3))
{
MessageBox.Show("3 detected")
}
Run Code Online (Sandbox Code Playgroud)