random

Common
JVM
JS
Native
1.3
fun CharSequence.random(): Char

Returns a random character from this char sequence.

Exceptions

NoSuchElementException - if this char sequence is empty.

Common
JVM
JS
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.