标签:self for regex app 判断 red lua nbsp format
/// 判断一串字符串是否都是汉字
- (BOOL)isAllCheniseWithString:(NSString *)string{
NSString *regex =@"(^[\u4e00-\u9fa5]+$)";
NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",regex];
return [pred evaluateWithObject:string];
}
标签:self for regex app 判断 red lua nbsp format
原文地址:https://www.cnblogs.com/mamamia/p/13259979.html