Last active
January 3, 2016 12:39
-
-
Save aug2uag/8464566 to your computer and use it in GitHub Desktop.
NSString is all digits
This file contains hidden or 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)isAllDigits:(NSString *)input | |
| { | |
| NSCharacterSet* nonNumbers = [[NSCharacterSet decimalDigitCharacterSet] invertedSet]; | |
| NSRange r = [input rangeOfCharacterFromSet: nonNumbers]; | |
| return r.location == NSNotFound; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment