Created
January 2, 2013 20:07
-
-
Save codeswimmer/4437493 to your computer and use it in GitHub Desktop.
iOS: Search A String In Array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -(void)searchString:(NSString *)str inArray:(NSArray *)arr{ | |
| for (id key in arr) { | |
| //check if there is a matching string (key and str) | |
| if ([key rangeOfString:str options:NSCaseInsensitiveSearch].location != NSNotFound) { | |
| NSLog(@"String: %@ Found", key); | |
| } | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment