iOS 判斷字符串是不是純中文字符以及字符串的範圍

判斷一個字符串是不是純中文字符,代碼以下lua + (BOOL)isChinese:(NSString *)userName { NSString *match = @"(^[\u4e00-\u9fa5]+$)"; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF matches %@", match]
相關文章
相關標籤/搜索