dimanche 7 juillet 2019

C# using a range of indexes in an if statment

I have this simple code:

if(number == arrayOfNumbers[1]){
//some code
}

And I want the code to be like this:

if(number == arrayOfNumbers[index>=1  /*any index that is equal or bigger than one*/]{
//some code
}

does this kind of functions exist? if not can you tell me the simplest way to write such a statement? also I don't mind coverting the array to a list if such a funciton exists for a list. Can sombody help? thank you

Aucun commentaire:

Enregistrer un commentaire