Extensions for java.lang.StringBuilder

JVM
1.4

appendLine

Appends value to this StringBuilder, followed by a line feed character (\n).

fun StringBuilder.appendLine(
    value: StringBuffer?
): StringBuilder
fun StringBuilder.appendLine(
    value: StringBuilder?
): StringBuilder
fun StringBuilder.appendLine(value: Int): StringBuilder
fun StringBuilder.appendLine(value: Short): StringBuilder
fun StringBuilder.appendLine(value: Byte): StringBuilder
fun StringBuilder.appendLine(value: Long): StringBuilder
fun StringBuilder.appendLine(value: Float): StringBuilder
fun StringBuilder.appendLine(value: Double): StringBuilder
JVM
1.0

appendln

Appends a line separator to this StringBuilder.

Appends value to this StringBuilder, followed by a line separator.

fun StringBuilder.appendln(
    value: StringBuffer?
): StringBuilder
fun StringBuilder.appendln(
    value: CharSequence?
): StringBuilder
fun StringBuilder.appendln(value: String?): StringBuilder
fun StringBuilder.appendln(value: Any?): StringBuilder
fun StringBuilder.appendln(
    value: StringBuilder?
): StringBuilder
fun StringBuilder.appendln(value: CharArray): StringBuilder
fun StringBuilder.appendln(value: Char): StringBuilder
fun StringBuilder.appendln(value: Boolean): StringBuilder
fun StringBuilder.appendln(value: Int): StringBuilder
fun StringBuilder.appendln(value: Short): StringBuilder
fun StringBuilder.appendln(value: Byte): StringBuilder
fun StringBuilder.appendln(value: Long): StringBuilder
fun StringBuilder.appendln(value: Float): StringBuilder
fun StringBuilder.appendln(value: Double): StringBuilder
JVM
1.4

appendRange

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

fun StringBuilder.appendRange(
    value: CharArray,
    startIndex: Int,
    endIndex: Int
): StringBuilder

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

fun StringBuilder.appendRange(
    value: CharSequence,
    startIndex: Int,
    endIndex: Int
): StringBuilder
JVM
1.3

clear

Clears the content of this string builder making it empty and returns this instance.

JVM
1.4

deleteAt

Removes the character at the specified index from this string builder and returns this instance.

fun StringBuilder.deleteAt(index: Int): StringBuilder
JVM
1.4

deleteRange

Removes characters in the specified range from this string builder and returns this instance.

fun StringBuilder.deleteRange(
    startIndex: Int,
    endIndex: Int
): StringBuilder
JVM
1.4

insertRange

Inserts characters in a subarray of the specified character array value into this string builder at the specified index and returns this instance.

fun StringBuilder.insertRange(
    index: Int,
    value: CharArray,
    startIndex: Int,
    endIndex: Int
): StringBuilder

Inserts characters in a subsequence of the specified character sequence value into this string builder at the specified index and returns this instance.

fun StringBuilder.insertRange(
    index: Int,
    value: CharSequence,
    startIndex: Int,
    endIndex: Int
): StringBuilder
JVM
1.0

set

Sets the character at the specified index to the specified value.

operator fun StringBuilder.set(index: Int, value: Char)
JVM
1.4

setRange

Replaces characters in the specified range of this string builder with characters in the specified string value and returns this instance.

fun StringBuilder.setRange(
    startIndex: Int,
    endIndex: Int,
    value: String
): StringBuilder
JVM
1.4

toCharArray

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

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