random

inline fun IntRange.random(): Int(source)
inline fun LongRange.random(): Long(source)
inline fun CharRange.random(): Char(source)

Returns a random element from this range.

Since Kotlin

1.3

Throws

if this range is empty.


Returns a random element from this range using the specified source of randomness.

Since Kotlin

1.3

Throws

if this range is empty.