KT-23356 Cross-platform function to convert CharArray slice to String

Signed-off-by: Valeriy Zhirnov <neonailol@gmail.com>
This commit is contained in:
Neonailol
2018-05-21 17:15:00 +03:00
committed by Ilya Gorbunov
parent 16ebcc6e77
commit ede2e227c2
4 changed files with 56 additions and 2 deletions
@@ -90,6 +90,20 @@ expect fun Char.isLowSurrogate(): Boolean
// From string.kt
/**
* Converts the characters in the specified array to a string.
*/
@SinceKotlin("1.2")
public expect fun String(chars: CharArray): String
/**
* Converts the characters from a portion of the specified array to a string.
*/
@SinceKotlin("1.2")
public expect fun String(chars: CharArray, offset: Int, length: Int): String
internal expect fun String.nativeIndexOf(str: String, fromIndex: Int): Int
internal expect fun String.nativeLastIndexOf(str: String, fromIndex: Int): Int