美文网首页
(IOS)判断姓名格式

(IOS)判断姓名格式

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

    +(BOOL)validateUserName:(NSString *)name

    {

        NSString *userNameRegex =@"^[A-Za-z0-9]{3,20}+$";

        NSPredicate *userNamePredicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",userNameRegex];

        BOOLB = [userNamePredicate evaluateWithObject:name];

        returnB;

    }

    相关文章

      网友评论

          本文标题:(IOS)判断姓名格式

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