判断字符串是否为数字-备

#define NUMBERS @"0123456789"

[[NSCharacterSet characterSetWithCharactersInString:NUMBERS]invertedSet];

NSString * filtered = [[string componentsSeparatedByCharactersInSet:cs]componentsJoinedByString:@""];

 

BOOL ISNumber = [string isEqualToString:filtered];

原文地址:https://www.cnblogs.com/isItOk/p/5215574.html