+ (BOOL)usernameCheck:(NSString *)string{
NSCharacterSet *characterSet = [NSCharacterSet characterSetWithCharactersInString:@"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_"];
characterSet = [characterSet invertedSet];
NSRange range = [string rangeOfCharacterFromSet:characterSet];
if (range.location != NSNotFound) {
return NO;
}
return YES;
}
No comments:
Post a Comment