code

Returns the code of this Char.

Code of a Char is the value it was constructed with, and the UTF-16 code unit corresponding to this Char.

Since Kotlin

1.5

Samples

import java.util.*
import kotlin.test.*

fun main() { 
   //sampleStart 
   val string = "0Azβ"
println(string.map { it.code }) // [48, 65, 122, 946] 
   //sampleEnd
}