In C#, instead of doing if(index == 7 || index == 8), is there a way to combine them? I\'m thinking of something like if(index == (7, 8)).
if(index == 7 || index == 8)
if(index == (7, 8))
No way to do that, but you could certainly do a range using if( index >=7 && index <= 8 ). But giving it a list of numbers would require you to create an array or list object and then use a method to do this. But that's just overkill.
if( index >=7 && index <= 8 )