开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜