var buffer = new StringBuffer();
buffer.append("This ");
buffer.append("is ");
//Nested callings - the append method returns the buffer itself
buffer.append("a ").append("test");
alert(buffer); //Message: "This is a test"
| Name | Type | Default | Description |
|---|---|---|---|
| initialCapacity | Numeric | 10 | The initial capacity for append operations without needing to resize the internal array (not bytes) |
| initialCapacity | The initial capacity for append operations without needing to resize the internal array (not bytes) |
| append | Appends a value |
| clear | Clears the buffer |
| length | Returns the buffered string length |
| toString | Returns the buffered String |
|
initialCapacity
The initial capacity for append operations without needing to resize the internal array (not bytes) |
|
append
Appends a value Arguments
|
||||||||
|
clear
Clears the buffer |
||||||||
|
length
Returns the buffered string length |
||||||||
|
toString
Returns the buffered String |