randomOrNull
@ExperimentalStdlibApi fun ByteArray.randomOrNull(): Byte?
@ExperimentalStdlibApi fun ShortArray.randomOrNull(): Short?
@ExperimentalStdlibApi fun IntArray.randomOrNull(): Int?
@ExperimentalStdlibApi fun LongArray.randomOrNull(): Long?
@ExperimentalStdlibApi fun FloatArray.randomOrNull(): Float?
@ExperimentalStdlibApi fun DoubleArray.randomOrNull(): Double?
@ExperimentalStdlibApi fun BooleanArray.randomOrNull(): Boolean?
@ExperimentalStdlibApi fun CharArray.randomOrNull(): Char?
@ExperimentalStdlibApi @ExperimentalUnsignedTypes fun ULongArray.randomOrNull(): ULong?
@ExperimentalStdlibApi @ExperimentalUnsignedTypes fun UByteArray.randomOrNull(): UByte?
@ExperimentalStdlibApi @ExperimentalUnsignedTypes fun UShortArray.randomOrNull(): UShort?
Returns a random element from this array, or null
if this array is empty.
@ExperimentalStdlibApi fun <T> Array<out T>.randomOrNull(
random: Random
): T?
@ExperimentalStdlibApi fun ShortArray.randomOrNull(
random: Random
): Short?
@ExperimentalStdlibApi fun FloatArray.randomOrNull(
random: Random
): Float?
@ExperimentalStdlibApi fun DoubleArray.randomOrNull(
random: Random
): Double?
@ExperimentalStdlibApi fun BooleanArray.randomOrNull(
random: Random
): Boolean?
@ExperimentalStdlibApi @ExperimentalUnsignedTypes fun ULongArray.randomOrNull(
random: Random
): ULong?
@ExperimentalStdlibApi @ExperimentalUnsignedTypes fun UByteArray.randomOrNull(
random: Random
): UByte?
@ExperimentalStdlibApi @ExperimentalUnsignedTypes fun UShortArray.randomOrNull(
random: Random
): UShort?
Returns a random element from this array using the specified source of randomness, or null
if this array is empty.
@ExperimentalStdlibApi fun <T> Collection<T>.randomOrNull(): T?
Returns a random element from this collection, or null
if this collection is empty.
@ExperimentalStdlibApi fun <T> Collection<T>.randomOrNull(
random: Random
): T?
Returns a random element from this collection using the specified source of randomness, or null
if this collection is empty.