NSString *string = @"hello bla bla";if ([string rangeOfString:@"bla"].location == NSNotFound) {NSLog(@"string does not contain bla");} else {NSLog(@"string contains bla!");}或是if ([string rangeOfString:@"bla"].location != NSNotFound)
NSLog(@"string contains bla!");
沒有留言:
張貼留言