Created
September 5, 2017 08:46
-
-
Save WangXiaoxi/6e0d5707711281622c4ca6f0630136b7 to your computer and use it in GitHub Desktop.
判断是否有中文
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//判断是否是中文 | |
- (BOOL)isChinese:(NSString *)str { | |
for(int i=0; i<[str length];i++) | |
{ | |
int a = [str characterAtIndex:i]; | |
if( a > 0x4e00 && a < 0x9fff) | |
{ | |
return YES; | |
} | |
} | |
return NO; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment