查询单词里面包含“ang”的字符串

NSArray *array = [[NSArray alloc]initWithObjects:@"beijing",@"shanghai",@"guangzou",@"wuhan", nil];

        NSString *string = @"ang";

        NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF CONTAINS %@",string];

        NSLog(@"%@",[array filteredArrayUsingPredicate:pred]);    ;

posted @ 2016-01-11 13:07  流浪法师0  阅读(296)  评论(0编辑  收藏  举报