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.

Constructor
StringBuilder()
Attributes
sizeSource Code
shared Integer size

Returns the size of the current content.

stringSource Code
shared actual String string

The resulting string. If no characters have been appended, the empty string.

Inherited Attributes
Attributes inherited from: Object
Methods
appendSource Code
shared StringBuilder append(String string)

Append the characters in the given string.

appendAllSource Code
shared StringBuilder appendAll(String... strings)

Append the characters in the given strings.

appendCharacterSource Code
shared StringBuilder appendCharacter(Character character)

Append the given character.

appendNewlineSource Code
shared StringBuilder appendNewline()

Append a newline character.

appendSpaceSource Code
shared StringBuilder appendSpace()

Append a space character.

deleteSource Code
shared StringBuilder delete(Integer pos, Integer count)

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.

insertSource Code
shared StringBuilder insert(Integer pos, Character|String content)

Insert a String or Character at the specified position. If the position is beyond the end of the current string, 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.

resetSource Code
shared StringBuilder reset()

Remove all content and return to initial state.

Inherited Methods
Methods inherited from: Object