W3cubDocs

/Kotlin

StringBuilder

typealias StringBuilder = StringBuilder

Platform and version requirements: Kotlin 1.1, JVM

class StringBuilder : Appendable, CharSequence

Platform and version requirements: JS

Constructors

<init>

StringBuilder(capacity: Int)
StringBuilder(content: CharSequence)
StringBuilder(content: String = "")

Properties

length

val length: Int

Returns the length of this character sequence.

Functions

append

fun append(c: Char): StringBuilder
fun append(csq: CharSequence?): StringBuilder
fun append(
    csq: CharSequence?, 
    start: Int, 
    end: Int
): StringBuilder
fun append(obj: Any?): StringBuilder

get

fun get(index: Int): Char

Returns the character at the specified index in this character sequence.

reverse

fun reverse(): StringBuilder

subSequence

fun subSequence(start: Int, end: Int): CharSequence

Returns a new character sequence that is a subsequence of this character sequence, starting at the specified startIndex and ending right before the specified endIndex.

toString

fun toString(): String

Returns a string representation of the object.

© 2010–2017 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/-string-builder/