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

阅读更多
-(NSMutableArray *)containCharacter NSMutableArray *)arrayDynamic
{
    for (int i=0; i    {
        if ([arrayDynamic[i] rangeOfString:@"hk"].length>0)
            [arrayDynamic removeObjectAtIndex:i];
       
        if ([arrayDynamic[i] rangeOfString:@"jj"].length>0)
            [arrayDynamic removeObjectAtIndex:i];

    }
    return arrayDynamic;
}

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