kotlin-range-sets / com.github.jonpeterson.kotlin.ranges / RangeSet / contains

contains

open fun contains(element: ClosedRange<T>): Boolean (source)

Checks if all values in the specified range are present in the set.

Examples:

assert(IntRangeSet(listOf(5..8, 11..16)).contains(6..7) == true)
assert(IntRangeSet(listOf(5..8, 11..16)).contains(6..12) == false)


Parameters

element - range of values to determine presence of

Return
whether all values are all contained within the set