Guest User

Untitled

a guest
Jun 30th, 2012
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. Evaluate/compare NSString with wildcards?
  2. NSString *filePath = @"file://Users/test/Desktop/file.txt";
  3. NSString *matchCriteria = @"file://*/file.*";
  4.  
  5. NSString *filePath = @"file://Users/test/Desktop/file.txt";
  6. NSString *matchCriteria = @"file://*/file.*";
  7.  
  8. NSPredicate *pred = [NSPredicate predicateWithFormat:@"self LIKE %@", matchCriteria];
  9.  
  10. BOOL filePathMatches = [pred evaluateWithObject:filePath];
Advertisement
Add Comment
Please, Sign In to add comment