class StringBuilder
source · line 5public class StringBuilder public constructor(initialCapacity: Long = 0L) : ToString
- Supertype
ToString
Accumulates UTF-8 bytes and copies immutable snapshots when converted to text. The optional initial capacity reserves bytes without adding content.
function append
source · line 80public fun append(value: Int): StringBuilder
Appends the decimal representation of a signed integer.
parameter value
source · line 80value: Int
function append
source · line 82public fun append(value: Int16): StringBuilder
Appends the decimal representation of a signed integer.
parameter value
source · line 82value: Int16
function toString
source · line 139public override fun toString(): String
- Overrides
toString· ToString
Copies the current UTF-8 prefix into an immutable string.
function append
source · line 125public fun <T: ToString> append(value: T): StringBuilder
Converts once before appending, preserving reentrant builder modifications.
type parameter T
source · line 125T: ToString
parameter value
source · line 125value: T
constructor constructor
source · line 5constructor(initialCapacity: Long = 0L)
parameter initialCapacity
source · line 5initialCapacity: Long = 0L
function append
source · line 46public fun append(value: String): StringBuilder
Appends text and returns this builder for chaining.
parameter value
source · line 46value: String
function append
source · line 93public fun append(value: Char): StringBuilder
Appends one Unicode scalar without allocating an intermediate String.
parameter value
source · line 93value: Char
function append
source · line 84public fun append(value: Int8): StringBuilder
Appends the decimal representation of a signed integer.
parameter value
source · line 84value: Int8
function append
source · line 69public fun append(value: ULong): StringBuilder
Appends an unsigned integer without allocating an intermediate String.
parameter value
source · line 69value: ULong
function append
source · line 86public fun append(value: UInt): StringBuilder
Appends the decimal representation of an unsigned integer.
parameter value
source · line 86value: UInt
function append
source · line 88public fun append(value: UInt16): StringBuilder
Appends the decimal representation of an unsigned integer.
parameter value
source · line 88value: UInt16
function append
source · line 58public fun append(value: Long): StringBuilder
Appends a signed integer without allocating an intermediate String.
parameter value
source · line 58value: Long
function clear
source · line 150public fun clear(): StringBuilder
Removes content in constant time, preserving capacity and existing snapshots.
function append
source · line 115public fun append(value: Boolean): StringBuilder
Appends the fixed Boolean text without allocating an intermediate String.
parameter value
source · line 115value: Boolean
function append
source · line 90public fun append(value: UInt8): StringBuilder
Appends the decimal representation of an unsigned integer.
parameter value
source · line 90value: UInt8