//判断字符串str 中是否含有“,” if([str rangeOfString:@","].location !=NSNotFound) { NSLog(@"yes"); } else { NSLog(@"no"); }