decapitalize

Common
JVM
JS
Native
1.0
@DeprecatedSinceKotlin("1.5") fun String.decapitalize(): String
(Common source) (JVM source) (JS source) (Native source)
Deprecated: Use replaceFirstChar instead.

Returns a copy of this string having its first letter lowercased using the rules of the default locale, or the original string if it's empty or already starts with a lower case letter.

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

fun main(args: Array<String>) {
//sampleStart
println("abcd".decapitalize()) // abcd
println("Abcd".decapitalize()) // abcd
//sampleEnd
}
JVM
1.4
@DeprecatedSinceKotlin("1.5") fun String.decapitalize(
    locale: Locale
): String

(source)
Deprecated: Use replaceFirstChar instead.

Returns a copy of this string having its first letter lowercased using the rules of the specified locale, or the original string, if it's empty or already starts with a lower case letter.