Created
May 8, 2015 15:31
-
-
Save ThinhPhan/1c2249fa1e7710a07aab to your computer and use it in GitHub Desktop.
Check a string is a number or not
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)isNumeric:(NSString *)string | |
{ | |
NSScanner *scanner = [NSScanner scannerWithString:string]; | |
return [scanner scanInteger:NULL] && [scanner isAtEnd]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment