You can write a check on the condition that a variable belongs to a range of values, for example:
if (0 < i && i < 10) { // ... }
Is it possible to do a similar check for switch / case statements without listing case's inside the switch?
switch (i) { case 1: // ... break; // ... case 9: // ... break; }