hello, guys) pretty noob question, but stuck) How ...
# announcements
k
hello, guys) pretty noob question, but stuck) How to generate string with K symbols? In java, i write something like this, but how to do the same in Kotlin?
Copy code
fun generateString(len: Int) : String {
        var res = ""
        for (i in 0..len)
            res += (97 +Math.floor(Math.random() * 26)) as Char
        
        return res
    }
compiler tells me "that cast can never succeed"