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.5

Samples

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
}

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.5

Samples

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
}