I am having string like:
NSString *str = @"Helloworld.123 456";
I need to get the characters one by one from the string and check whether it is an numeric value.
Is there any predefined method for this?
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.
To get a character from string you can use
-characterAtIndex:method. AndNSCharacterSetclass allows you to check easily if given character is a number:P.S. If your task is more general then just checking each single character then there also might be a more general built-in method for that task…