Kotlin Randomly Select From List

May 14, 2019
val messages = listOf("A", "B", "C")

val message = Random.nextInt(messages.size).let { index ->
    messages[index]
}
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.