Do these two ranges intersect? If so, how do I know?
问题 From Apple's documentation: Return Value A range describing the intersection of range1 and range2—that is, a range containing the indices that exist in both ranges. Discussion If the returned range’s length field is 0, then the two ranges don’t intersect, and the value of the location field is undefined. Okay, so let's say I have two ranges: (lldb) p rangeOne (NSRange) $3 = location=11, length=4 (lldb) p rangeTwo (NSRange) $4 = location=14, length=0 And I calculate the intersection: NSRange