From 0580039ded5ef7cbc6ceaff3fc87606ee2192095 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Tue, 17 Mar 2015 23:02:04 +0300 Subject: [PATCH] Provide additional string conversion methods to match missing java.lang.String constructors. Fixes KT-5019 --- libraries/stdlib/src/kotlin/text/StringsJVM.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libraries/stdlib/src/kotlin/text/StringsJVM.kt b/libraries/stdlib/src/kotlin/text/StringsJVM.kt index 824b5424298..56048ec262b 100644 --- a/libraries/stdlib/src/kotlin/text/StringsJVM.kt +++ b/libraries/stdlib/src/kotlin/text/StringsJVM.kt @@ -187,6 +187,16 @@ public fun String(bytes: ByteArray): String = java.lang.String(bytes, Charsets.U */ public fun String(chars: CharArray): String = java.lang.String(chars) as String +/** + * Converts the characters from a portion of the specified array to a string. + */ +public fun String(chars: CharArray, offset: Int, length: Int): String = java.lang.String(chars, offset, length) as String + +/** + * Converts the code points from a portion of the specified Unicode code point array to a string. + */ +public fun String(codePoints: IntArray, offset: Int, length: Int): String = java.lang.String(codePoints, offset, length) as String + /** * Converts the contents of the specified StringBuffer to a string. */