Answers for "how to create random alphanumeric in kotlin"

1

how to create random alphanumeric in kotlin

fun getRandomString(length: Int) : String {
    val allowedChars = ('A'..'Z') + ('a'..'z') + ('0'..'9')
    return (1..length)
        .map { allowedChars.random() }
        .joinToString("")
}
Posted by: Guest on November-06-2021

Code answers related to "how to create random alphanumeric in kotlin"

Browse Popular Code Answers by Language