Deprecate old Char and String case conversion api #KT-43023

This commit is contained in:
Abduqodiri Qurbonzoda
2021-04-08 02:37:09 +03:00
parent 7a3781ec14
commit cbef9dad36
9 changed files with 70 additions and 9 deletions
+4
View File
@@ -120,6 +120,8 @@ public fun Int.digitToChar(radix: Int): Char {
/**
* Converts this character to lower case using Unicode mapping rules of the invariant locale.
*/
@Deprecated("Use lowercaseChar() instead.", ReplaceWith("lowercaseChar()"))
@DeprecatedSinceKotlin(warningSince = "1.5")
public expect fun Char.toLowerCase(): Char
/**
@@ -152,6 +154,8 @@ public expect fun Char.lowercase(): String
/**
* Converts this character to upper case using Unicode mapping rules of the invariant locale.
*/
@Deprecated("Use uppercaseChar() instead.", ReplaceWith("uppercaseChar()"))
@DeprecatedSinceKotlin(warningSince = "1.5")
public expect fun Char.toUpperCase(): Char
/**
@@ -14,6 +14,8 @@ import kotlin.jvm.JvmName
/**
* Returns a copy of this string converted to upper case using the rules of the default locale.
*/
@Deprecated("Use uppercase() instead.", ReplaceWith("uppercase()"))
@DeprecatedSinceKotlin(warningSince = "1.5")
public expect fun String.toUpperCase(): String
/**
@@ -31,6 +33,8 @@ public expect fun String.uppercase(): String
/**
* Returns a copy of this string converted to lower case using the rules of the default locale.
*/
@Deprecated("Use lowercase() instead.", ReplaceWith("lowercase()"))
@DeprecatedSinceKotlin(warningSince = "1.5")
public expect fun String.toLowerCase(): String
/**
@@ -54,6 +58,8 @@ public expect fun String.lowercase(): String
*
* @sample samples.text.Strings.capitalize
*/
@Deprecated("Use replaceFirstChar instead.", ReplaceWith("replaceFirstChar { if (it.isLowerCase()) it.titlecase() else it.toString() }"))
@DeprecatedSinceKotlin(warningSince = "1.5")
public expect fun String.capitalize(): String
/**
@@ -62,6 +68,8 @@ public expect fun String.capitalize(): String
*
* @sample samples.text.Strings.decapitalize
*/
@Deprecated("Use replaceFirstChar instead.", ReplaceWith("replaceFirstChar { it.lowercase() }"))
@DeprecatedSinceKotlin(warningSince = "1.5")
public expect fun String.decapitalize(): String
/**