NSString *temp = @"如何判断包含某字符串";
NSString *str = @"判断";
NSRange foundObj=[temp rangeOfString:str options:NSCaseInsensitiveSearch];
if(foundObj.length>0) {
NSLog(@"Yes ! str found");
}
else {
NSLog(@"Oops ! no str");
}
NSString *temp = @"如何判断包含某字符串";
NSString *str = @"判断";
NSRange foundObj=[temp rangeOfString:str options:NSCaseInsensitiveSearch];
if(foundObj.length>0) {
NSLog(@"Yes ! str found");
}
else {
NSLog(@"Oops ! no str");
}