Created
May 30, 2014 10:10
-
-
Save JeOam/85256f7b495358beef6e to your computer and use it in GitHub Desktop.
判断字符串中是否包含汉字
This file contains 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) 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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
via click