Compare NSString with Chinese letters ios
Does anyone know if it works wel开发者_JAVA百科l to compare NSStrings with chinese letters?
Yes, it works well.
NSString *chnString = @"中文, 汉语";
if ([chnString isEqualToString:@"中文, 汉语"]){
NSLog(@"Equal");}
else
NSLog(@"NOT Equal");
if ([chnString isEqualToString:@"中文, 汉"])
NSLog(@"Equal");
else
NSLog(@"NOT Equal");
And results are:
2011-09-27 15:08:14.527 iProj-iPad[3716:207] Equal
2011-09-27 15:08:14.528 iProj-iPad[3716:207] NOT Equal
精彩评论