last

Returns the last character.

fun CharSequence.last(): Char(source)
fun main() {
    val text = "Hello, world!"
    val lastChar = text.last()
    println("The last character is: $lastChar")
}

Source