Question : how to create random alphanumeric in kotlin
Answered by : hannan
fun getRandomString(length: Int) : String { val allowedChars = ('A'..'Z') + ('a'..'z') + ('0'..'9') return (1..length) .map { allowedChars.random() } .joinToString("")
}
Source : | Last Update : Sat, 13 Nov 21