- (BOOL)isPureInt:(NSString *)string {
NSScanner *scan = [NSScanner scannerWithString:string];
int val;
return [scan scanInt:&val]&&[scan isAtEnd];
}
- (BOOL)isPureInt:(NSString *)string {
NSScanner *scan = [NSScanner scannerWithString:string];
int val;
return [scan scanInt:&val]&&[scan isAtEnd];
}
本文标题:判断字符串是否由纯数字组成
本文链接:https://www.haomeiwen.com/subject/vsqspttx.html
网友评论