isUpperCase

Common
JVM
JS
1.0
fun Char.isUpperCase(): Boolean
(Common source) (JVM source) (JS source)

Returns true if this character 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.

import java.util.*
import kotlin.test.*

fun main(args: Array<String>) {
//sampleStart
val chars = listOf('A', 'Ψ', 'a', '1', '+')
val (upperCases, notUpperCases) = chars.partition { it.isUpperCase() }
println(upperCases) // [A, Ψ]
println(notUpperCases) // [a, 1, +]
//sampleEnd
}