W3cubDocs

/Kotlin

decapitalize

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
fun String.decapitalize(): String

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 kotlin.test.*

fun main(args: Array<String>) {
//sampleStart
println("abcd".decapitalize()) // abcd
println("Abcd".decapitalize()) // abcd
//sampleEnd
}
Platform and version requirements: JVM (1.4)
fun String.decapitalize(locale: Locale): String

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.

© 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/decapitalize.html