What is the correct way to escape ASCII 0 in Kotlin?
fun main(args : Array<String>) {
val x = StringBuffer(20)
x.append("asdf")
x.append('0')
}
What is the correct way to escape ASCII 0 in Kotlin?
fun main(args : Array<String>) {
val x = StringBuffer(20)
x.append("asdf")
x.append('0')
}
It's possible to convert Int to Сhar with toChar() call.
x.append(0.toChar())
You can also write an extension for Int if you need a lot of such conversions:
val Int.u: Char get() = this.toChar()
fun main(args : Array<String>) {
val x = StringBuffer(20)
x.append(0.u)
println(“${49.u}${9650.u}”)
}