From 1a323d60ff915217d2d2828380cd94822b677514 Mon Sep 17 00:00:00 2001 From: Abduqodiri Qurbonzoda Date: Fri, 17 Jan 2020 01:52:22 +0300 Subject: [PATCH] Deprecate old CharArray to String conversion api #KT-31343 (cherry picked from commit a232664c0f498cfa75a3f5f227c9d589b777d012) --- runtime/src/main/kotlin/kotlin/text/Strings.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/runtime/src/main/kotlin/kotlin/text/Strings.kt b/runtime/src/main/kotlin/kotlin/text/Strings.kt index caa239508fa..40aa81c763c 100644 --- a/runtime/src/main/kotlin/kotlin/text/Strings.kt +++ b/runtime/src/main/kotlin/kotlin/text/Strings.kt @@ -223,6 +223,7 @@ public actual fun CharSequence.repeat(n: Int): String { /** * Converts the characters in the specified array to a string. */ +@Deprecated("Use CharArray.concatToString() instead", ReplaceWith("chars.concatToString()")) public actual fun String(chars: CharArray): String = chars.concatToString() /** @@ -231,6 +232,7 @@ public actual fun String(chars: CharArray): String = chars.concatToString() * @throws IndexOutOfBoundsException if either [offset] or [length] are less than zero * or `offset + length` is out of [chars] array bounds. */ +@Deprecated("Use CharArray.concatToString(startIndex, endIndex) instead", ReplaceWith("chars.concatToString(offset, offset + length)")) public actual fun String(chars: CharArray, offset: Int, length: Int): String { if (offset < 0 || length < 0 || offset + length > chars.size) throw ArrayIndexOutOfBoundsException()