W3cubDocs

/Kotlin

removeRange

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
fun CharSequence.removeRange(
    startIndex: Int, 
    endIndex: Int
): CharSequence

Returns a char sequence with content of this char sequence where its part at the given range is removed.

Parameters

startIndex - the index of the first character to be removed.

endIndex -

the index of the first character after the removed part to keep in the string.

endIndex is not included in the removed part.

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
fun String.removeRange(
    startIndex: Int, 
    endIndex: Int
): String

Removes the part of a string at a given range.

Parameters

startIndex - the index of the first character to be removed.

endIndex -

the index of the first character after the removed part to keep in the string.

endIndex is not included in the removed part.

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
fun CharSequence.removeRange(range: IntRange): CharSequence

Returns a char sequence with content of this char sequence where its part at the given range is removed.

The end index of the range is included in the removed part.

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
fun String.removeRange(range: IntRange): String

Removes the part of a string at the given range.

The end index of the range is included in the removed part.

© 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/remove-range.html