objective-c rangeOfString若数组中某个元素含有某个字符,则去除这个元素

-(NSMutableArray *)containCharacter NSMutableArray *)arrayDynamic
{
    for (int i=0; i<arrayDynamic.count; i++)
    {
        if ([arrayDynamic[i] rangeOfString:@"hk"].length>0)
            [arrayDynamic removeObjectAtIndex:i];
       
        if ([arrayDynamic[i] rangeOfString:@"jj"].length>0)
            [arrayDynamic removeObjectAtIndex:i];

    }
    return arrayDynamic;
}

你可能感兴趣的:(objective-c,rangeofstring)