How to check whether a char is digit or not in Objective-C?

前端 未结 6 1330
一向
一向 2021-02-05 10:46

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

6条回答
  •  野性不改
    2021-02-05 11:09

    This is actually quite simple:

    isdigit([YOUR_STRING characterAtIndex:YOUR_POS])
    

提交回复
热议问题