How can I check if a string (NSString) contains another smaller string?
NSString
I was hoping for something like:
NSString *string = @\"hello bla
Swift 4 And Above
let str = "Hello iam midhun" if str.contains("iam") { //contains substring } else { //doesn't contain substring }
Objective-C
NSString *stringData = @"Hello iam midhun"; if ([stringData containsString:@"iam"]) { //contains substring } else { //doesn't contain substring }