On this page
StringBuffer class
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.
 
Properties
- isEmpty → bool
    read-only
 - 
    
Returns whether the buffer is empty. This is a constant-time operation.
 - isNotEmpty → bool
    read-only
 - 
    
Returns whether the buffer is not empty. This is a constant-time operation.
 - length → int
    read-only
 - 
    
Returns the length of the content that has been accumulated so far. This is a constant-time operation.
 - hashCode → int
    read-only, inherited
 - 
    
The hash code for this object.
 - runtimeType → Type
    read-only, inherited
 - 
    
A representation of the runtime type of the object.
 
Operators
- operator ==(
other) → bool inherited - 
    
The equality operator.
 
Methods
- clear(
) → void  - 
    
Clears the string buffer.
 - toString(
) → String  - 
    
Returns the contents of buffer as a concatenated string.
 - write(
Object obj) → void  - 
    
Adds the contents of
obj, converted to a string, to the buffer. - writeAll(
Iterable objects, [ String separator = "" ]) → void  - 
    
Iterates over the given
objectsandwrites them in sequence. - writeCharCode(
int charCode) → void  - 
    
Adds the string representation of
charCodeto the buffer. - writeln(
[Object obj = "" ]) → void  - 
    
Converts
objto a String by invokingObject.toStringand adds the result tothis, followed by a newline. - noSuchMethod(
Invocation invocation) → dynamic inherited - 
    
Invoked when a non-existent method or property is accessed.
 
© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
 https://api.dartlang.org/stable/1.24.3/dart-core/StringBuffer-class.html