W3cubDocs

/Kotlin

appendRange

Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
fun <T : Appendable> T.appendRange(
    value: CharSequence, 
    startIndex: Int, 
    endIndex: Int
): T

Appends a subsequence of the specified character sequence value to this Appendable and returns this instance.

Parameters

value - the character sequence from which a subsequence is appended.

startIndex - the beginning (inclusive) of the subsequence to append.

endIndex - the end (exclusive) of the subsequence to append.

Exceptions

IndexOutOfBoundsException - or IllegalArgumentException when startIndex or endIndex is out of range of the value character sequence indices or when startIndex > endIndex.

Platform and version requirements: JS (1.4), Native (1.4)
fun StringBuilder.appendRange(
    value: CharArray, 
    startIndex: Int, 
    endIndex: Int
): StringBuilder

Appends characters in a subarray of the specified character array value to this string builder and returns this instance.

Characters are appended in order, starting at specified startIndex.

Parameters

value - the array from which characters are appended.

startIndex - the beginning (inclusive) of the subarray to append.

endIndex - the end (exclusive) of the subarray to append.

Exceptions

IndexOutOfBoundsException - or IllegalArgumentException when startIndex or endIndex is out of range of the value array indices or when startIndex > endIndex.

Platform and version requirements: JS (1.4), Native (1.4)
fun StringBuilder.appendRange(
    value: CharSequence, 
    startIndex: Int, 
    endIndex: Int
): StringBuilder

Appends a subsequence of the specified character sequence value to this string builder and returns this instance.

Parameters

value - the character sequence from which a subsequence is appended.

startIndex - the beginning (inclusive) of the subsequence to append.

endIndex - the end (exclusive) of the subsequence to append.

Exceptions

IndexOutOfBoundsException - or IllegalArgumentException when startIndex or endIndex is out of range of the value character sequence indices or when startIndex > endIndex.

© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/append-range.html