fun Char.toUpperCase(): Char
Converts this character to uppercase.
import kotlin.test.*
import java.util.*
fun main(args: Array<String>) {
//sampleStart
val chars = listOf('a', 'ω', '1', 'A', '+')
val upperCases = chars.map { it.toUpperCase() }
println(upperCases) // [A, Ω, 1, A, +]
//sampleEnd
}
Converts this character to uppercase.
fun String.toUpperCase(): String
Returns a copy of this string converted to upper case using the rules of the default locale.
import kotlin.test.*
fun main(args: Array<String>) {
//sampleStart
println("Iced frappé!".toUpperCase()) // ICED FRAPPÉ!
//sampleEnd
}
Returns a copy of this string converted to upper case using the rules of the default locale.
fun String.toUpperCase(locale: Locale): String
Returns a copy of this string converted to upper case using the rules of the specified locale.
© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/to-upper-case.html