1.过滤数据的时候用到该类,例如
int i = 0,count = [arrayFilter count]; for(i = 0; i < count; i ++) { NSString *arrayItem = (NSString *)[arrayFilter objectAtIndex:i]; NSPredicate *filterPredicate = [[NSPredicate predicateWithFormat:@"SELF CONTAINS %@",arrayItem]; NSLog(@"Filtered array with filter %@,%@",arrayItem,[arrayContents filteredArrayUsingPredicate:filterPredicate]); } |
2.NOT (SELF in %@)
3.SELF == %@(简单比较)
4.SELF like %@
5.SELF like[cd] %@(
[c]表示忽略大小写,[d]表示忽略重音,可以在一起使用)
6.SELF matches %@(正则表达式)
原文链接:https://www.f2er.com/regex/362050.html