KT-38817 capitalize uses title case for the first char where available
This unifies its behavior with new capitalize overload with Locale. Co-authored-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@@ -70,8 +70,11 @@ public actual fun CharSequence.regionMatches(thisOffset: Int, other: CharSequenc
|
||||
|
||||
|
||||
/**
|
||||
* Returns a copy of this string having its first letter uppercased, or the original string,
|
||||
* if it's empty or already starts with an upper case letter.
|
||||
* Returns a copy of this string having its first letter titlecased using the rules of the default locale,
|
||||
* or the original string if it's empty or already starts with a title case letter.
|
||||
*
|
||||
* The title case of a character is usually the same as its upper case with several exceptions.
|
||||
* The particular list of characters with the special title case form depends on the underlying platform.
|
||||
*
|
||||
* @sample samples.text.Strings.capitalize
|
||||
*/
|
||||
@@ -80,8 +83,8 @@ public actual fun String.capitalize(): String {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a copy of this string having its first letter lowercased, or the original string,
|
||||
* if it's empty or already starts with a lower case letter.
|
||||
* 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.
|
||||
*
|
||||
* @sample samples.text.Strings.decapitalize
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user