randomOrNull

Returns a random element from this range, or null if this range is empty.

Since Kotlin

1.4

Returns a random element from this range using the specified source of randomness, or null if this range is empty.

Since Kotlin

1.4

Returns a random element from this range, or null if this range is empty.

Since Kotlin

1.5

Returns a random element from this range using the specified source of randomness, or null if this range is empty.

Since Kotlin

1.5