NSArray *arrData = [NSArray arrayWithObjects:
@\"cloud,country,plant\",
@\"country,cloud,plant\",
@\"country
Try below code,
It will work,
NSPredicate *hsPredicate = [NSPredicate predicateWithBlock:^BOOL(id _Nonnull evaluatedObject, NSDictionary * _Nullable bindings) {
NSArray *sepretArray =[((NSString*)evaluatedObject) componentsSeparatedByString:@","];
NSPredicate *subPredicate = [NSPredicate predicateWithFormat:@"self == %@",@"cloud"];
return ([sepretArray filteredArrayUsingPredicate:subPredicate].count > 0);
}];
NSArray *arrResult = [arrData filteredArrayUsingPredicate:hsPredicate];