core-ktx / androidx.util / rangeTo

rangeTo

inline infix fun <T : Comparable<T>> T.rangeTo(that: T): Range<T>

Creates a range from this Comparable value to that.

Exceptions

IllegalArgumentException - if this value is comparatively smaller than that.