Skip to content

Instantly share code, notes, and snippets.

@pratikshabhisikar
Created February 23, 2012 11:09
Show Gist options
  • Select an option

  • Save pratikshabhisikar/1892389 to your computer and use it in GitHub Desktop.

Select an option

Save pratikshabhisikar/1892389 to your computer and use it in GitHub Desktop.
NSRange searchStringRange = [textView rangeOfString:@"string to search goes here" options:NSCaseInsensitiveSearch];
if (searchStringRange.location != NSNotFound) {
// Got the search string.
NSString *searchStringInTextView = [textView substringWithRange:searchStringRange];
NSLog(@"The search string is: %@", searchStringInTextView);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment