toCharArray

fun toCharArray(destination: CharArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = this.length)(source)

Copies characters from this string builder into the destination character array.

Since Kotlin

1.4

Parameters

destination

the array to copy to.

destinationOffset

the position in the array to copy to, 0 by default.

startIndex

the beginning (inclusive) of the range to copy, 0 by default.

endIndex

the end (exclusive) of the range to copy, length of this string builder by default.

Throws

when the subrange doesn't fit into the destination array starting at the specified destinationOffset, or when that index is out of the destination array indices range.

fun toCharArray(destination: CharArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = this.length)(source)

Copies characters from this string builder into the destination character array.

Since Kotlin

1.4

Parameters

destination

the array to copy to.

destinationOffset

the position in the array to copy to, 0 by default.

startIndex

the beginning (inclusive) of the range to copy, 0 by default.

endIndex

the end (exclusive) of the range to copy, length of this string builder by default.

Throws

when the subrange doesn't fit into the destination array starting at the specified destinationOffset, or when that index is out of the destination array indices range.