Created
July 17, 2012 16:21
-
-
Save wokalski/3130397 to your computer and use it in GitHub Desktop.
NSRangeContainsRange - check if NSRange contains the other NSRange :)
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
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