Check if a string contains another string in iOS 8

NSString *string = @"hello bla blah";
if ([string containsString:@"bla"]) {
  NSLog(@"string contains bla!");
} else {
  NSLog(@"string does not contain bla");
}

Comments

Popular posts from this blog

Scroll UITextField above Keyboard in a UITableView OR UIScrollView in Swift and Objective C

Reverting all Xcode settings to default settings

CGRectIntegral