Skip to content

Instantly share code, notes, and snippets.

@wokalski
Created July 17, 2012 16:21
Show Gist options
  • Save wokalski/3130397 to your computer and use it in GitHub Desktop.
Save wokalski/3130397 to your computer and use it in GitHub Desktop.
NSRangeContainsRange - check if NSRange contains the other NSRange :)
bool NSRangeContainsRange (NSRange range1, NSRange range2) {
BOOL retval = NO;
if (range1.location <= range2.location && range1.location+range1.length >= range2.length+range2.location) {
retval = YES;;
}
return retval;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment