2011-11-10 30 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 

不完全是什麼問,但也許有幫助。

相關問題