fun substring(startIndex: Int): String
Returns a new String that contains characters in this string builder at startIndex (inclusive) and up to the length (exclusive).
IndexOutOfBoundsException
- if startIndex is less than zero or greater than the length of this string builder.
fun substring(startIndex: Int, endIndex: Int): String
Returns a new String that contains characters in this string builder at startIndex (inclusive) and up to the endIndex (exclusive).
IndexOutOfBoundsException
- or IllegalArgumentException when startIndex or endIndex is out of range of this string builder 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/-string-builder/substring.html