📅  最后修改于: 2022-03-11 14:53:32.152000             🧑  作者: Mango
fun getRandomString(length: Int) : String {
val allowedChars = ('A'..'Z') + ('a'..'z') + ('0'..'9')
return (1..length)
.map { allowedChars.random() }
.joinToString("")
}