StringBuffer class

A class for concatenating strings efficiently.

A class for concatenating strings efficiently.

Allows for the incremental building of a string using write*() methods. The strings are concatenated to a single string only when toString is called.

Implements:

Constructors

StringBuffer ( [Object content = ""] )
Creates the string buffer with an initial content.

Instance Properties

length int
read-only
isEmpty bool
read-only
isNotEmpty bool
read-only

Instance Methods

write ( Object obj ) → void
Adds the contents of obj, converted to a string, to the buffer.
writeCharCode ( int charCode ) → void
Adds the string representation of charCode to the buffer.
writeAll ( Iterable objects, [String separator = ""] ) → void
Iterates over the given [objects] and [write]s them in sequence.
writeln ( [Object obj = ""] ) → void
Converts [obj] to a String by invoking [Object.toString] and adds the result to this, followed by a newline.
clear ( ) → void
Clears the string buffer.
toString ( ) → String
Returns the contents of buffer as a concatenated string.