toUpperCase
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.
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.
fun String.toUpperCase(locale: Locale): String
Returns a copy of this string converted to upper case using the rules of the specified locale.