Hey everoyne. I'm wondering If it's possible to construct a switch statement which takes in a character and determines weither that character is a number or not, or an alphabetical number.
switch(i) /*character*/ {
case '0': /*ok it's a number, doesn't have to be zero, any number from 0-9*/
case 'a': /*ok it's an alphabetical number, doesn't have to be a but any from a-z*/
}
Or do I have to write for each case , like so
switch(i) {
case '0': break;
case '1': break;
....
....
....
case '9': break;
case 'a': break;
....
....
.... 'z': break;
}
I feel like I've seen a lighter version of switch statment where they used tricks like this??