titlecaseChar

Common
JVM
JS
Native
1.5
For Common, JVM, Native

Converts this character to title case using Unicode mapping rules of the invariant locale.

This function performs one-to-one character mapping. To support one-to-many character mapping use the titlecase function. If this character has no mapping equivalent, the result of calling uppercaseChar is returned.

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

fun main(args: Array<String>) {
//sampleStart
val chars = listOf('a', 'Dž', 'ʼn', '+', 'ß')
val titlecaseChar = chars.map { it.titlecaseChar() }
val titlecase = chars.map { it.titlecase() }
println(titlecaseChar) // [A, Dž, ʼn, +, ß]
println(titlecase) // [A, Dž, ʼN, +, Ss]
//sampleEnd
}
For JS

Converts this character to title case using Unicode mapping rules of the invariant locale.

This function performs one-to-one character mapping. To support one-to-many character mapping use the titlecase function. If this character has no mapping equivalent, the result of calling uppercaseChar is returned.

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

fun main(args: Array<String>) {
//sampleStart
val chars = listOf('a', 'Dž', 'ʼn', '+', 'ß')
val titlecaseChar = chars.map { it.titlecaseChar() }
val titlecase = chars.map { it.titlecase() }
println(titlecaseChar) // [A, Dž, ʼn, +, ß]
println(titlecase) // [A, Dž, ʼN, +, Ss]
//sampleEnd
}