W3cubDocs

/Kotlin

random

Platform and version requirements: JVM (1.3), JS (1.3), Native (1.3)
fun CharSequence.random(): Char

Returns a random character from this char sequence.

Exceptions

NoSuchElementException - if this char sequence is empty.

Platform and version requirements: JVM (1.3), JS (1.3), Native (1.3)
fun CharSequence.random(random: Random): Char

Returns a random character from this char sequence using the specified source of randomness.

Exceptions

NoSuchElementException - if this char sequence is empty.

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