Skip to content

Instantly share code, notes, and snippets.

@WangXiaoxi
Created September 5, 2017 08:46
Show Gist options
  • Save WangXiaoxi/6e0d5707711281622c4ca6f0630136b7 to your computer and use it in GitHub Desktop.
Save WangXiaoxi/6e0d5707711281622c4ca6f0630136b7 to your computer and use it in GitHub Desktop.
判断是否有中文
//判断是否是中文
- (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