lowercase

Common
JVM
JS
Native
1.5

Converts this character to lower case using Unicode mapping rules of the invariant locale.

This function supports one-to-many character mapping, thus the length of the returned string can be greater than one. For example, '\u0130'.lowercase() returns "\u0069\u0307", where '\u0130' is the LATIN CAPITAL LETTER I WITH DOT ABOVE character (İ). If this character has no lower case mapping, the result of toString() of this char is returned.

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

fun main(args: Array<String>) {
//sampleStart
val chars = listOf('A', 'Ω', '1', 'a', '+', 'İ')
val lowercaseChar = chars.map { it.lowercaseChar() }
val lowercase = chars.map { it.lowercase() }
println(lowercaseChar) // [a, ω, 1, a, +, i]
println(lowercase) // [a, ω, 1, a, +, \u0069\u0307]
//sampleEnd
}
Common
JVM
JS
Native
1.5

Returns a copy of this string converted to lower case using Unicode mapping rules of the invariant locale.

This function supports one-to-many and many-to-one character mapping, thus the length of the returned string can be different from the length of the original string.

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

fun main(args: Array<String>) {
//sampleStart
println("Iced frappé!".lowercase()) // iced frappé!
//sampleEnd
}
JVM
1.5
fun Char.lowercase(locale: Locale): String
(source)

Converts this character to lower case using Unicode mapping rules of the specified locale.

This function supports one-to-many character mapping, thus the length of the returned string can be greater than one. For example, '\u0130'.lowercase(Locale.US) returns "\u0069\u0307", where '\u0130' is the LATIN CAPITAL LETTER I WITH DOT ABOVE character (İ). If this character has no lower case mapping, the result of toString() of this char is returned.

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

fun main(args: Array<String>) {
//sampleStart
val chars = listOf('A', 'Ω', '1', 'a', '+', 'İ')
val lowercase = chars.map { it.lowercase() }
val turkishLocale = Locale.forLanguageTag("tr")
val lowercaseTurkish = chars.map { it.lowercase(turkishLocale) }
println(lowercase) // [a, ω, 1, a, +, \u0069\u0307]
println(lowercaseTurkish) // [a, ω, 1, a, +, i]
//sampleEnd
}
JVM
1.5
fun String.lowercase(locale: Locale): String
(source)

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

This function supports one-to-many and many-to-one character mapping, thus the length of the returned string can be different from the length of the original string.

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

fun main(args: Array<String>) {
//sampleStart
println("KOTLIN".lowercase()) // kotlin
val turkishLocale = Locale.forLanguageTag("tr")
println("KOTLIN".lowercase(turkishLocale)) // kotlın
//sampleEnd
}