isTitleCase
Returns true if the Unicode character corresponding to this code point is a title case letter.
A character is considered to be a title case letter if its category is CharCategory.TITLECASE_LETTER.
Since Kotlin
2.5Samples
import kotlin.text.unicode.*
import kotlin.test.*
fun main() {
//sampleStart
val codePoints = "Dž_Lj_Nj_Dz_1Aa+𐐀𐐨".asCodePointSequence()
val [titleCases, notTitleCases] = codePoints.partition { it.isTitleCase() }
println(titleCases) // [Dž, Lj, Nj, Dz]
println(notTitleCases) // [_, _, _, _, 1, A, a, +, 𐐀, 𐐨]
//sampleEnd
}Content copied to clipboard
Returns true if the Unicode character corresponding to this code point is a title case letter.
A character is considered to be a title case letter if its category is CharCategory.TITLECASE_LETTER.
Since Kotlin
2.5Samples
import kotlin.text.unicode.*
import kotlin.test.*
fun main() {
//sampleStart
val codePoints = "Dž_Lj_Nj_Dz_1Aa+𐐀𐐨".asCodePointSequence()
val [titleCases, notTitleCases] = codePoints.partition { it.isTitleCase() }
println(titleCases) // [Dž, Lj, Nj, Dz]
println(notTitleCases) // [_, _, _, _, 1, A, a, +, 𐐀, 𐐨]
//sampleEnd
}Content copied to clipboard