/************************************************************
|
* * Hyphenate CONFIDENTIAL
|
* __________________
|
* Copyright (C) 2016 Hyphenate Inc. All rights reserved.
|
*
|
* NOTICE: All information contained herein is, and remains
|
* the property of Hyphenate Inc.
|
* Dissemination of this information or reproduction of this material
|
* is strictly forbidden unless prior written permission is obtained
|
* from Hyphenate Inc.
|
*/
|
|
#import "NSString+Valid.h"
|
|
@implementation NSString (Valid)
|
|
- (BOOL)isChinese
|
{
|
NSString *match = @"(^[\u4e00-\u9fa5]+$)";
|
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF matches %@", match];
|
return [predicate evaluateWithObject:self];
|
}
|
|
@end
|