iphone-common-codes-ccteam源代码 CCNSPredicate.m

来源:互联网 发布:苹果ios6系统能用软件 编辑:程序博客网 时间:2024/06/07 00:45
////  CCNSPredicate.m//  CCFC////  Created by xichen on 11-12-27.//  Copyright 2011 ccteam. All rights reserved.//#import "CCNSPredicate.h"@implementation NSPredicate(cc)// returns whether the str is in accordance with the format+ (BOOL)isValidFormat:(NSString *)str withFormat:(NSString *)format {        NSPredicate *predicate = [NSPredicate predicateWithFormat:                                                                   @"SELF MATCHES %@", format];                return [predicate evaluateWithObject:str];}// not ok+ (BOOL)isChineseChar:(NSString *)str{        return [self isValidFormat:str withFormat:@"[\u4e00-\u9fa5]"];}@end


可能有更新:

googlecode链接地址:http://code.google.com/p/iphone-common-codes-ccteam/source/browse/trunk/CCFC/files/CCNSPredicate.m
github地址: https://github.com/cxsjabc/iphone-common-codes-ccteam/tree/master/CCFC/files/CCNSPredicate.m


原创粉丝点击