Deprecate old CharArray to String conversion api #KT-31343

(cherry picked from commit a232664c0f498cfa75a3f5f227c9d589b777d012)
This commit is contained in:
Abduqodiri Qurbonzoda
2020-01-17 01:52:22 +03:00
committed by Vasily Levchenko
parent 740f361885
commit 1a323d60ff
@@ -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()