vendredi 18 janvier 2019

Using if else statements with arrays in C#

I want to create an array in C# that holds a bunch of food items.

isafood = [ "apple","pear","grape"];

if(item == isafood){

    apple / pear /grape
}
else
{

}

then i want to do an if statement to see if variable item equals one of the food items in the list.

Aucun commentaire:

Enregistrer un commentaire