W3cubDocs

/Kotlin

toLowerCase

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
fun Char.toLowerCase(): Char
For JVM

Converts this character to lowercase.

import kotlin.test.*
import java.util.*

fun main(args: Array<String>) {
//sampleStart
val chars = listOf('A', 'Ω', '1', 'a', '+')
val lowerCases = chars.map { it.toLowerCase() }
println(lowerCases) // [a, ω, 1, a, +]
//sampleEnd
}
For Native

Converts this character to lowercase.

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
fun String.toLowerCase(): String
For Common, JVM, JS

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

import kotlin.test.*

fun main(args: Array<String>) {
//sampleStart
println("Iced frappé!".toLowerCase()) // iced frappé!
//sampleEnd
}
For Native

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

Platform and version requirements: JVM (1.0)
fun String.toLowerCase(locale: Locale): String

Returns a copy of this string converted to lower 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-lower-case.html