is Upper Case
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.5Samples
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
}
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
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.5Samples
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
}
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
}