Builder utility for constructing strings by incrementally appending strings or characters.
value builder = StringBuilder(); builder.append("hello"); builder.appendCharacter(' '); builder.append("world"); String hello = builder.string; //hello world
no subtypes hierarchy
Initializer |
StringBuilder() |
Attributes | |
hash | Source Codeshared actual Integer hash The hash value of the value, which allows the value to be an element of a hash-based set or key of a hash-based map. Implementations must respect the constraint that:
Therefore, a class which refines In general, Note that when executing on a Java Virtual Machine, the
64-bit |
lastIndex | Source Codeshared actual Integer? lastIndex The index of the last element of the list, or Refines List.lastIndex |
size | Source Codeshared actual Integer size |
string | Source Codeshared actual String string The resulting string. If no characters have been appended, the empty string. |
Inherited Attributes |
Attributes inherited from: Object |
Attributes inherited from: Collection<Element> |
Attributes inherited from: Correspondence<Key,Item> |
Attributes inherited from: Iterable<Element,Absent> |
Attributes inherited from: List<Element> |
Methods | |
append | Source Codeshared StringBuilder append(String string) Append the characters in the given |
appendAll | Source Codeshared StringBuilder appendAll({String*} strings) Append the characters in the given |
appendCharacter | Source Codeshared StringBuilder appendCharacter(Character character) Append the given |
appendNewline | Source Codeshared StringBuilder appendNewline() Append a newline character. |
appendSpace | Source Codeshared StringBuilder appendSpace() Append a space character. |
clear | Source Codeshared StringBuilder clear() Remove all content and return to initial state. |
delete | Source Codeshared StringBuilder delete(Integer index, Integer length) Deletes the specified number of characters
from the current content, starting at the specified
|
deleteInitial | Source Codeshared StringBuilder deleteInitial(Integer length) Deletes the specified number of characters
from the start of the string. If |
deleteTerminal | Source Codeshared StringBuilder deleteTerminal(Integer length) Deletes the specified number of characters
from the end of the string. If |
equals | Source Codeshared actual Boolean equals(Object that) Determine if two values are equal. Implementations should respect the constraints that:
Furthermore it is recommended that implementations
ensure that if A class which explicitly refines Note that an implementation of |
getFromFirst | Source Codeshared actual Character? getFromFirst(Integer index) The |
insert | Source Codeshared StringBuilder insert(Integer index, String string) |
insertCharacter | Source Codeshared StringBuilder insertCharacter(Integer index, Character character) |
iterator | Source Codeshared actual Iterator<Character> iterator() An iterator for the elements belonging to this stream. |
prepend | Source Codeshared StringBuilder prepend(String string) Prepend the characters in the given |
prependAll | Source Codeshared StringBuilder prependAll({String*} strings) Prepend the characters in the given |
prependCharacter | Source Codeshared StringBuilder prependCharacter(Character character) Prepend the given |
replace | Source Codeshared StringBuilder replace(Integer index, Integer length, String string) Replaces the specified number of characters
from the current content, starting at the specified
|
reverseInPlace | Source Codeshared StringBuilder reverseInPlace() Reverses the order of the current characters. |
substring | Source Codeshared String substring(Integer index, Integer length) |