lowercase

expect fun Char.lowercase(): String

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.

Since Kotlin

1.5

Samples

import samples.*
import java.util.*
import kotlin.test.*
fun main() { 
   //sampleStart 
   val chars = listOf('A', 'Ω', '1', 'a', '+', 'İ')
val lowercaseChar = chars.map { it.lowercaseChar() }
val lowercase = chars.map { it.lowercase() }
assertPrints(lowercaseChar, "[a, ω, 1, a, +, i]")
assertPrints(lowercase, "[a, ω, 1, a, +, \u0069\u0307]") 
   //sampleEnd
}

expect fun String.lowercase(): String

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.

Since Kotlin

1.5

Samples

import samples.*
import java.util.Locale
import kotlin.test.*
fun main() { 
   //sampleStart 
   assertPrints("Iced frappé!".lowercase(), "iced frappé!") 
   //sampleEnd
}
fun Char.lowercase(locale: Locale): String

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.

Since Kotlin

1.5

Samples

import samples.*
import java.util.*
import kotlin.test.*
fun main() { 
   //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) }
assertPrints(lowercase, "[a, ω, 1, a, +, \u0069\u0307]")
assertPrints(lowercaseTurkish, "[a, ω, 1, a, +, i]") 
   //sampleEnd
}

inline fun String.lowercase(locale: Locale): String

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.

Since Kotlin

1.5

Samples

import samples.*
import java.util.Locale
import kotlin.test.*
fun main() { 
   //sampleStart 
   assertPrints("KOTLIN".lowercase(), "kotlin")
val turkishLocale = Locale.forLanguageTag("tr")
assertPrints("KOTLIN".lowercase(turkishLocale), "kotlın") 
   //sampleEnd
}

actual inline fun Char.lowercase(): String

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.

Since Kotlin

1.5

Samples

import samples.*
import java.util.*
import kotlin.test.*
fun main() { 
   //sampleStart 
   val chars = listOf('A', 'Ω', '1', 'a', '+', 'İ')
val lowercaseChar = chars.map { it.lowercaseChar() }
val lowercase = chars.map { it.lowercase() }
assertPrints(lowercaseChar, "[a, ω, 1, a, +, i]")
assertPrints(lowercase, "[a, ω, 1, a, +, \u0069\u0307]") 
   //sampleEnd
}

actual inline fun String.lowercase(): String

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.

Since Kotlin

1.5

Samples

import samples.*
import java.util.Locale
import kotlin.test.*
fun main() { 
   //sampleStart 
   assertPrints("Iced frappé!".lowercase(), "iced frappé!") 
   //sampleEnd
}
actual inline fun Char.lowercase(): String

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.

Since Kotlin

1.5

Samples

import samples.*
import java.util.*
import kotlin.test.*
fun main() { 
   //sampleStart 
   val chars = listOf('A', 'Ω', '1', 'a', '+', 'İ')
val lowercaseChar = chars.map { it.lowercaseChar() }
val lowercase = chars.map { it.lowercase() }
assertPrints(lowercaseChar, "[a, ω, 1, a, +, i]")
assertPrints(lowercase, "[a, ω, 1, a, +, \u0069\u0307]") 
   //sampleEnd
}

actual inline fun String.lowercase(): String

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.

Since Kotlin

1.5

Samples

import samples.*
import java.util.Locale
import kotlin.test.*
fun main() { 
   //sampleStart 
   assertPrints("Iced frappé!".lowercase(), "iced frappé!") 
   //sampleEnd
}
actual fun Char.lowercase(): String

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.

Since Kotlin

1.5

Samples

import samples.*
import java.util.*
import kotlin.test.*
fun main() { 
   //sampleStart 
   val chars = listOf('A', 'Ω', '1', 'a', '+', 'İ')
val lowercaseChar = chars.map { it.lowercaseChar() }
val lowercase = chars.map { it.lowercase() }
assertPrints(lowercaseChar, "[a, ω, 1, a, +, i]")
assertPrints(lowercase, "[a, ω, 1, a, +, \u0069\u0307]") 
   //sampleEnd
}

actual fun String.lowercase(): String

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.

Since Kotlin

1.5

Samples

import samples.*
import java.util.Locale
import kotlin.test.*
fun main() { 
   //sampleStart 
   assertPrints("Iced frappé!".lowercase(), "iced frappé!") 
   //sampleEnd
}