StringBuilder
Builds mutable text by appending UTF-16 code units.
length counts code units, so a supplementary Unicode character occupies two indexes. Capacity is the allocated buffer size, not the content length. clear retains that buffer; toString and subSequence return independent immutable snapshots. Buffer growth and snapshots are subject to the Guest heap quota.
Parameters
initial buffer size in UTF-16 code units; defaults to 16.
See also
Throws
if capacity is negative.
Properties
Functions
Copies a range of value to the end of this builder.
Removes all content while retaining the allocated capacity for reuse.
Returns whether this string contains char.
Grows the buffer when minimumCapacity exceeds the current capacity.
Returns whether this character sequence is empty or contains only whitespace.
Returns whether this character sequence contains no characters.
Returns whether this character sequence contains a non-whitespace character.
Returns whether this character sequence contains at least one character.
Visits UTF-16 code units in order. Stored iterators are supported and own their position.
Finds the last matching character.
Finds the last matching substring, starting at the last character.
Searches backwards from startIndex for char.
Searches backwards from startIndex for string, comparing UTF-16 code units.
Splits on CRLF, LF or CR, retaining empty lines including the final line.
Removes suffix when present, otherwise returns this string.
Splits on delimiter, retaining empty parts. Zero limit means no limit; positive limit keeps the remaining suffix.
Splits on delimiter, retaining empty parts. An empty delimiter separates UTF-16 code units, including empty ends.
Copies the selected range into an immutable String.
Materializes the selected UTF-16 range as an immutable String.
Counts and indexes refer to UTF-16 code units, including individual surrogate halves.
Removes leading and trailing whitespace.
Removes trailing whitespace.
Removes leading whitespace.