toUpperCase

Common
JVM
JS
Native
1.0
fun Char.toUpperCase(): Char
For JVM

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
}
For Native

Converts this character to uppercase.

Common
JVM
JS
Native
1.0
fun String.toUpperCase(): String
For Common, JVM, JS

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
}
For Native

Returns a copy of this string converted to upper case using the rules of the default locale.

JVM
1.0
fun String.toUpperCase(locale: Locale): String

Returns a copy of this string converted to upper case using the rules of the specified locale.