Created
July 29, 2014 02:02
-
-
Save jrodriguez-ifuelinteractive/4d016370a7a4dc8eca0b to your computer and use it in GitHub Desktop.
Search within an NSString
This file contains 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
NSString *string = @"Hello Bla Bla"; | |
NSString *searchText = @"bla"; | |
NSUInteger searchOptions = NSCaseInsensitiveSearch | NSDiacriticInsensitiveSearch; | |
NSRange searchRange = NSMakeRange(0, string.length); | |
NSRange foundRange = [string rangeOfString:searchText options:searchOptions range:searchRange]; | |
if (foundRange.length > 0) { | |
NSLog(@"Text Found."); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment