2011-11-10 33 views

回答

1

在这个例子中使用NSCaseInsensitiveSearch项目1场& 3比赛因为做项目2 & 4:

NSString *morningList = @" Καλημέρα, ΚΑΛΗΜΕΡΑ, καλημέρα, κΑΛΗΜερα"; 
NSArray *morningTests = [NSArray arrayWithObjects:@"Καλημέρα", @"ΚΑΛΗΜΕΡΑ", @"καλημέρα", @"κΑΛΗΜερα", nil]; 

for (NSString *morning in morningTests) { 
    NSRange range = [morningList rangeOfString:morning options:NSCaseInsensitiveSearch]; 
    NSLog(@"location of '%@': %lu", morning, range.location); 
} 

的NSLog输出:

location of 'Καλημέρα': 1 
location of 'ΚΑΛΗΜΕΡΑ': 11 
location of 'καλημέρα': 1 
location of 'κΑΛΗΜερα': 11 

不完全是什么问,但也许有帮助。

相关问题