isUpperCase
Returns true if the Unicode character corresponding to this code point is upper case.
A character is considered to be an upper case character if its category is CharCategory.UPPERCASE_LETTER, or it has contributory property Other_Uppercase as defined by the Unicode Standard.
Since Kotlin
2.5Samples
import kotlin.text.unicode.*
import kotlin.test.*
fun main() {
//sampleStart
val codePoints = "1Aa+ππ¨".asCodePointSequence()
val [upperCases, notUpperCases] = codePoints.partition { it.isUpperCase() }
println(upperCases) // [A, π]
println(notUpperCases) // [1, a, +, π¨]
//sampleEnd
}Content copied to clipboard
Returns true if the Unicode character corresponding to this code point is upper case.
A character is considered to be an upper case character if its category is CharCategory.UPPERCASE_LETTER, or it has contributory property Other_Uppercase as defined by the Unicode Standard.
Since Kotlin
2.5Samples
import kotlin.text.unicode.*
import kotlin.test.*
fun main() {
//sampleStart
val codePoints = "1Aa+ππ¨".asCodePointSequence()
val [upperCases, notUpperCases] = codePoints.partition { it.isUpperCase() }
println(upperCases) // [A, π]
println(notUpperCases) // [1, a, +, π¨]
//sampleEnd
}Content copied to clipboard