I need to check if a char is digit or not.
NSString *strTest=@"Test55";
char c =[strTest characterAtIndex:4];
I need to find out if ‘c’ is a digit or not. How can I implement this check in Objective-C?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In standard C there is a function
int isdigit( int ch );defined in “ctype.h”. It will return nonzero (TRUE) if ch is a digit.Also you can check it manually: