overlapsWith

open fun overlapsWith(other: Range): Boolean(source)

Does the other 'Range' overlap with this 'Range'?

If two ranges overlap, this range or the other range contains the begin or the end of the other range.

Note that if the ends are "touching" (i.e. a begin position == end position), this counts as an overlap because the positions refer to characters, as opposed to boundary between characters.

For example, there is an overlap at "C" in the following ranges, with "C" existing within both ranges:

Range 1: ABC
Range 2:   CDE