Since strings are immutable, this class is used for constructing a string by incrementally appending characters to the empty string. This class is mutable but threadsafe.
Initializer |
StringBuilder() |
Attributes | |
size | Source Code shared Integer size Returns the size of the current content. |
string | Source Code shared actual String string The resulting string. If no characters have been appended, the empty string. Refined declaration: string |
Inherited Attributes |
Attributes inherited from: Object |
Methods | |
append | Source Code Append the characters in the given string. |
appendAll | Source Code Append the characters in the given strings. |
appendCharacter | Source Code Append the given character. |
appendNewline | Source Code shared StringBuilder appendNewline() Append a newline character. |
appendSpace | Source Code shared StringBuilder appendSpace() Append a space character. |
delete | Source Code Deletes the specified number of characters from the current content, starting at the specified position. If the position is beyond the end of the current content, nothing is deleted. If the number of characters to delete is greater than the available characters from the given position, the content is truncated at the given position. |
insert | Source Code Insert a the new content is simply appended to the current content. If the position is a negative number, the new content is inserted at index 0. |
insertCharacter | Source Code Insert a |
reset | Source Code shared StringBuilder reset() Remove all content and return to initial state. |
Inherited Methods |
Methods inherited from: Object |