star90
asked on
How to check if a char belongs to a group of chars, C solution.
Hi,
I want to know how can I check if a char belongs to a group of chars.
for example:
char a;
if ( (a=='1') || (a=='2') || (a=='3') || (A=='4') || (a=='5') || (a=='6')||(a=='7') || (A=='8') )
{; }
Is there a way to write it in a short way by defining a group of chars and checking if char a belongs to this group?
The solution has to be in C.
Thanks!
I want to know how can I check if a char belongs to a group of chars.
for example:
char a;
if ( (a=='1') || (a=='2') || (a=='3') || (A=='4') || (a=='5') || (a=='6')||(a=='7') || (A=='8') )
{; }
Is there a way to write it in a short way by defining a group of chars and checking if char a belongs to this group?
The solution has to be in C.
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thaks for your answer!
star90