判断是否包含某个字符串

if ([string rangeOfString:str].location != NSNotFound) {

//YES

}else{

//NO

}

原文地址:https://www.cnblogs.com/huoran1120/p/5614510.html