W3cubDocs

/Kotlin

toTitleCase

Platform and version requirements: JVM (1.0)
fun Char.toTitleCase(): Char

Converts this character to titlecase.

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

fun main(args: Array<String>) {
//sampleStart
val chars = listOf('a', 'Dž', '1', '+')
val titleCases = chars.map { it.toTitleCase() }
println(titleCases) // [A, Dž, 1, +]
//sampleEnd
}

See Also

Character.toTitleCase

© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/to-title-case.html