How can we check if a string is made up of numbers only. I am taking out a substring from a string and want to check if it is a numeric substring or not.
NSS
You could create an NSScanner and simply scan the string:
NSDecimal decimalValue; NSScanner *sc = [NSScanner scannerWithString:newString]; [sc scanDecimal:&decimalValue]; BOOL isDecimal = [sc isAtEnd];
Check out NSScanner's documentation for more methods to choose from.