Avoid hitting max argument limit in String(chars)
Rewrite CharArray to String conversions to appending chars one by one. Refine parameter checking in String(chars, offset, length) to adhere to the common exception contract and document it. #KT-29003
This commit is contained in:
@@ -100,6 +100,9 @@ public expect fun String(chars: CharArray): String
|
||||
|
||||
/**
|
||||
* Converts the characters from a portion of the specified array to a string.
|
||||
*
|
||||
* @throws IndexOutOfBoundsException if either [offset] or [length] are less than zero
|
||||
* or `offset + length` is out of [chars] array bounds.
|
||||
*/
|
||||
@SinceKotlin("1.2")
|
||||
public expect fun String(chars: CharArray, offset: Int, length: Int): String
|
||||
|
||||
Reference in New Issue
Block a user