intersect
fun <T : Comparable<T>> ClosedRange<T>.intersect(other: ClosedRange<T>): ClosedRange<T>?
Content copied to clipboard
Finds the intersection between two ranges, the resulting range may feature a single value (if the ranges only share an endpoint) or can be null, if they don't intersect at all.