Skip to content

Instantly share code, notes, and snippets.

@JeOam
Created May 30, 2014 10:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeOam/85256f7b495358beef6e to your computer and use it in GitHub Desktop.
Save JeOam/85256f7b495358beef6e to your computer and use it in GitHub Desktop.
判断字符串中是否包含汉字
- (BOOL) containsChinese:(NSString *)str {
for(int i = 0; i < [str length]; i++) {
int a = [str characterAtIndex:i];
if( a > 0x4e00 && a < 0x9fff)
return TRUE;
}
return FALSE;
}
@JeOam
Copy link
Author

JeOam commented May 30, 2014

via click

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment