Support String factory functions

This commit is contained in:
Ilya Matveev
2018-06-01 18:10:12 +07:00
committed by Pavel Punegov
parent 0e2fa56269
commit 5cde399600
@@ -44,3 +44,14 @@ public actual fun CharSequence.repeat(n: Int): String {
}
}
}
/**
* Converts the characters in the specified array to a string.
*/
// external fun fromCharArray(array: CharArray, start: Int, size: Int) : String
public actual fun String(chars: CharArray): String = fromCharArray(chars, 0, chars.size)
/**
* Converts the characters from a portion of the specified array to a string.
*/
public actual fun String(chars: CharArray, offset: Int, length: Int): String = fromCharArray(chars, offset, length)