Builder

open class Builder : CharSequence

A modified wrapper of StringBuilder that internally calls format on all append calls.

Constructors

Link copied to clipboard
constructor()
Create a new instance of the builder with default initial capacity 16.
constructor(@NonNull initial: String)
Create a new instance of the builder with the specified initial string.
constructor(capacity: Int)
Create a new instance of the builder with the specified initial capacity.

Functions

Link copied to clipboard
Append an object to the builder.
open fun append(@NonNull fstring: String, @Nullable objs: Array<Any>): Text.Builder
Append a string to the builder using a format call.
Link copied to clipboard
open fun appendCodePoint(codePoint: Int): Text.Builder
Appends the string representation of the codePoint argument to this sequence.
Link copied to clipboard
open fun charAt(index: Int): Char
Link copied to clipboard
open fun delete(start: Int, end: Int): Text.Builder
Removes the characters in a substring of this sequence.
Link copied to clipboard
Removes the char at the specified position in this sequence.
Link copied to clipboard
open fun indexOf(@NonNull str: String): Int
Returns the index within this string of the first occurrence of the specified substring.
open fun indexOf(@NonNull str: String, fromIndex: Int): Int
Returns the index within this string of the first occurrence of the specified substring, starting at the specified index.
Link copied to clipboard
open fun insert(offset: Int, @NonNull obj: Any): Text.Builder
Inserts the string representation of the Object argument into this character sequence.
open fun insert(offset: Int, @NonNull fstring: String, @Nullable objs: Array<Any>): Text.Builder
Inserts the string representation of the Object argument into this character sequence after applying a format call.
open fun insert(index: Int, @NonNull str: Array<Char>, offset: Int, len: Int): Text.Builder
Inserts the string representation of a subarray of the str array argument into this sequence.
Link copied to clipboard
open fun lastIndexOf(@NonNull str: String): Int
Returns the index within this string of the rightmost occurrence of the specified substring.
open fun lastIndexOf(@NonNull str: String, fromIndex: Int): Int
Returns the index within this string of the last occurrence of the specified substring.
Link copied to clipboard
open fun length(): Int
Link copied to clipboard
open fun replace(start: Int, end: Int, @NonNull str: String): Text.Builder
Replaces the characters in a substring of this sequence with characters in the specified String.
Link copied to clipboard
Causes this character sequence to be replaced by the reverse of the sequence.
Link copied to clipboard
open fun subSequence(start: Int, end: Int): CharSequence
Link copied to clipboard
open fun toString(): String

Inherited functions

Link copied to clipboard
open fun chars(): IntStream
Link copied to clipboard
open fun codePoints(): IntStream
Link copied to clipboard
open fun compare(cs1: CharSequence, cs2: CharSequence): Int