@ExperimentalStdlibApi fun String.toCharArray(): CharArray
Returns a CharArray containing characters of this string.
@ExperimentalStdlibApi fun String.toCharArray( startIndex: Int = 0, endIndex: Int = this.length ): CharArray
fun String.toCharArray( startIndex: Int, endIndex: Int ): CharArray
Returns a CharArray containing characters of this string or its substring.
startIndex
- the beginning (inclusive) of the substring, 0 by default.
endIndex
- the end (exclusive) of the substring, length of this string by default.
IndexOutOfBoundsException
- if startIndex is less than zero or endIndex is greater than the length of this string.
IllegalArgumentException
- if startIndex is greater than endIndex.
fun String.toCharArray( destination: CharArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = length ): CharArray
Copies characters from this string into the destination character array and returns that array.
destination
- the array to copy to.
destinationOffset
- the position in the array to copy to.
startIndex
- the start offset (inclusive) of the substring to copy.
endIndex
- the end offset (exclusive) of the substring to copy.
© 2010–2019 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/to-char-array.html