Answers for "random string in kotlin"

5

random string generator kotlin

private fun randomID(): String = List(16) {
  (('a'..'z') + ('A'..'Z') + ('0'..'9')).random()
}.joinToString("")
Posted by: Guest on July-11-2020
0

kotlin get random string

fun randomString(length: Int): String = List(length) {
	(32..126).random().toChar()
}.joinToString("")
Posted by: Guest on February-27-2022

Browse Popular Code Answers by Language