美文网首页
(IOS)判断手机格式

(IOS)判断手机格式

作者: rightmost | 来源:发表于2018-12-26 17:19 被阅读0次

+(BOOL)validateWithMobile:(NSString *)mobile

{

    NSString * phone =@"^1([3-9]\\d{9}$)";

    NSPredicate *phoneTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",phone];

    return[phoneTest evaluateWithObject:mobile];

}

相关文章

网友评论

      本文标题:(IOS)判断手机格式

      本文链接:https://www.haomeiwen.com/subject/ssfklqtx.html