isTitleCase

expect fun Char.isTitleCase(): Boolean

Returns true if this character is a title case letter.

A character is considered to be a title case letter if its category is CharCategory.TITLECASE_LETTER.

Since Kotlin

1.5

Samples

import samples.*
import java.util.*
import kotlin.test.*
fun main() { 
   //sampleStart 
   val chars = listOf('Dž', 'Lj', 'Nj', 'Dz', '1', 'A', 'a', '+')
val (titleCases, notTitleCases) = chars.partition { it.isTitleCase() }
assertPrints(titleCases, "[Dž, Lj, Nj, Dz]")
assertPrints(notTitleCases, "[1, A, a, +]") 
   //sampleEnd
}
actual inline fun Char.isTitleCase(): Boolean

Returns true if this character is a title case letter.

A character is considered to be a title case letter if its category is CharCategory.TITLECASE_LETTER.

Samples

import samples.*
import java.util.*
import kotlin.test.*
fun main() { 
   //sampleStart 
   val chars = listOf('Dž', 'Lj', 'Nj', 'Dz', '1', 'A', 'a', '+')
val (titleCases, notTitleCases) = chars.partition { it.isTitleCase() }
assertPrints(titleCases, "[Dž, Lj, Nj, Dz]")
assertPrints(notTitleCases, "[1, A, a, +]") 
   //sampleEnd
}
actual fun Char.isTitleCase(): Boolean

Returns true if this character is a title case letter.

A character is considered to be a title case letter if its category is CharCategory.TITLECASE_LETTER.

Since Kotlin

1.5

Samples

import samples.*
import java.util.*
import kotlin.test.*
fun main() { 
   //sampleStart 
   val chars = listOf('Dž', 'Lj', 'Nj', 'Dz', '1', 'A', 'a', '+')
val (titleCases, notTitleCases) = chars.partition { it.isTitleCase() }
assertPrints(titleCases, "[Dž, Lj, Nj, Dz]")
assertPrints(notTitleCases, "[1, A, a, +]") 
   //sampleEnd
}
actual fun Char.isTitleCase(): Boolean

Returns true if this character is a title case letter.

A character is considered to be a title case letter if its category is CharCategory.TITLECASE_LETTER.

Since Kotlin

1.5

Samples

import samples.*
import java.util.*
import kotlin.test.*
fun main() { 
   //sampleStart 
   val chars = listOf('Dž', 'Lj', 'Nj', 'Dz', '1', 'A', 'a', '+')
val (titleCases, notTitleCases) = chars.partition { it.isTitleCase() }
assertPrints(titleCases, "[Dž, Lj, Nj, Dz]")
assertPrints(notTitleCases, "[1, A, a, +]") 
   //sampleEnd
}