titlecaseCodePoint
Converts this code point 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 code point has no title case equivalent, the result of calling uppercaseCodePoint is returned.
Since Kotlin
2.5Samples
import kotlin.text.unicode.*
import kotlin.test.*
fun main() {
//sampleStart
val codePoints = "a+ว
ลร๐จ".asCodePointSequence()
val titlecaseCodePoints = codePoints.map { it.titlecaseCodePoint() }.toList()
val titlecase = codePoints.map { it.titlecase() }.toList()
println(titlecaseCodePoints) // [A, +, ว
, ล, ร, ๐]
println(titlecase) // [A, +, ว
, สผN, Ss, ๐]
//sampleEnd
}Content copied to clipboard
Converts this code point 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 code point has no title case equivalent, the result of calling uppercaseCodePoint is returned.
Since Kotlin
2.5Samples
import kotlin.text.unicode.*
import kotlin.test.*
fun main() {
//sampleStart
val codePoints = "a+ว
ลร๐จ".asCodePointSequence()
val titlecaseCodePoints = codePoints.map { it.titlecaseCodePoint() }.toList()
val titlecase = codePoints.map { it.titlecase() }.toList()
println(titlecaseCodePoints) // [A, +, ว
, ล, ร, ๐]
println(titlecase) // [A, +, ว
, สผN, Ss, ๐]
//sampleEnd
}Content copied to clipboard