W3cubDocs

/Kotlin

shuffled

fun <T> Iterable<T>.shuffled(): List<T>

Platform and version requirements: Kotlin 1.2

Returns a new list with the elements of this list randomly shuffled.

fun <T> Iterable<T>.shuffled(random: Random): List<T>

Platform and version requirements: Kotlin 1.2, JVM

Returns a new list with the elements of this list randomly shuffled using the specified random instance as the source of randomness.

© 2010–2018 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/shuffled.html