isUpperCase

Returns true if this character is an upper case letter.

A character is considered to be an upper case letter if its category is CharCategory.UPPERCASE_LETTER.

Since Kotlin

1.5

Samples



import java.util.*


import kotlin.test.*
fun main() { 
   //sampleStart 
   val chars = listOf('A', 'Ψ', 'a', '1', '+')
val (upperCases, notUpperCases) = chars.partition { it.isUpperCase() }
println(upperCases) // [A, Ψ]
println(notUpperCases) // [a, 1, +] 
   //sampleEnd
}
actual inline fun Char.isUpperCase(): Boolean(source)

Returns true if this character is upper case.

Samples



import java.util.*


import kotlin.test.*
fun main() { 
   //sampleStart 
   val chars = listOf('A', 'Ψ', 'a', '1', '+')
val (upperCases, notUpperCases) = chars.partition { it.isUpperCase() }
println(upperCases) // [A, Ψ]
println(notUpperCases) // [a, 1, +] 
   //sampleEnd
}

See also

actual fun Char.isUpperCase(): Boolean

Returns true if this character is an upper case letter.

A character is considered to be an upper case letter if its category is CharCategory.UPPERCASE_LETTER.

Since Kotlin

1.5

Samples



import java.util.*


import kotlin.test.*
fun main() { 
   //sampleStart 
   val chars = listOf('A', 'Ψ', 'a', '1', '+')
val (upperCases, notUpperCases) = chars.partition { it.isUpperCase() }
println(upperCases) // [A, Ψ]
println(notUpperCases) // [a, 1, +] 
   //sampleEnd
}
actual fun Char.isUpperCase(): Boolean

Returns true if this character is an upper case letter.

A character is considered to be an upper case letter if its category is CharCategory.UPPERCASE_LETTER.

Samples



import java.util.*


import kotlin.test.*
fun main() { 
   //sampleStart 
   val chars = listOf('A', 'Ψ', 'a', '1', '+')
val (upperCases, notUpperCases) = chars.partition { it.isUpperCase() }
println(upperCases) // [A, Ψ]
println(notUpperCases) // [a, 1, +] 
   //sampleEnd
}