1.判断是否为电话号码
+ (BOOL)validPhone:(NSString*) phoneString
{
NSTextCheckingType type = [[NSTextCheckingResult phoneNumberCheckingResultWithRange:NSMakeRange(0, phoneString.length)
phoneNumber:phoneString] resultType];
return type == NSTextCheckingTypePhoneNumber;
}
时间: 2024-10-14 01:54:34