# StringBuilder

public final class **StringBuilder** extends [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)  
implements [Appendable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Appendable.html) [CharSequence](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/CharSequence.html) [Serializable](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/Serializable.html) [CharSequence](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/CharSequence.html) A mutable sequence of characters. This class provides an API compatible
with `StringBuffer`, but with no guarantee of synchronization.
This class is designed for use as a drop-in replacement for
`StringBuffer` in places where the string buffer was being
used by a single thread (as is generally the case). Where possible,
it is recommended that this class be used in preference to
`StringBuffer` as it will be faster under most implementations.

The principal operations on a `StringBuilder` are the
`append` and `insert` methods, which are
overloaded so as to accept data of any type. Each effectively
converts a given datum to a string and then appends or inserts the
characters of that string to the string builder. The
`append` method always adds these characters at the end
of the builder; the `insert` method adds the characters at
a specified point.


For example, if `z` refers to a string builder object
whose current contents are "`start`", then
the method call `z.append("le")` would cause the string
builder to contain "`startle`", whereas
`z.insert(4, "le")` would alter the string builder to
contain "`starlet`".


In general, if sb refers to an instance of a `StringBuilder`,
then `sb.append(x)` has the same effect as
`sb.insert(sb.length(), x)`.


Every string builder has a capacity. As long as the length of the
character sequence contained in the string builder does not exceed
the capacity, it is not necessary to allocate a new internal
buffer. If the internal buffer overflows, it is automatically made larger.

Instances of `StringBuilder` are not safe for
use by multiple threads. If such synchronization is required then it is
recommended that `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuffer.html` be used.

Unless otherwise noted, passing a `null` argument to a constructor
or method in this class will cause a `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html` to be
thrown.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuffer.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html`

### Public Constructor Summary

|---|---|
|   | [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#StringBuilder())() Constructs a string builder with no characters in it and an initial capacity of 16 characters. |
|   | [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#StringBuilder(int))(int capacity) Constructs a string builder with no characters in it and an initial capacity specified by the `capacity` argument. |
|   | [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#StringBuilder(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) str) Constructs a string builder initialized to the contents of the specified string. |
|   | [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#StringBuilder(java.lang.CharSequence))([CharSequence](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/CharSequence.html) seq) Constructs a string builder that contains the same characters as the specified `CharSequence`. |

### Public Method Summary

|---|---|
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [append](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#append(boolean))(boolean b) |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [append](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#append(long))(long lng) |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [append](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#append(char))(char c) Appends the specified character to this Appendable. |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [append](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#append(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [append](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#append(char[],%20int,%20int))(char\[\] str, int offset, int len) |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [append](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#append(double))(double d) |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [append](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#append(char[]))(char\[\] str) |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [append](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#append(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) str) |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [append](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#append(java.lang.StringBuffer))([StringBuffer](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuffer.html) sb) Appends the specified `StringBuffer` to this sequence. |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [append](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#append(float))(float f) |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [append](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#append(int))(int i) |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [append](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#append(java.lang.CharSequence,%20int,%20int))([CharSequence](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/CharSequence.html) s, int start, int end) Appends a subsequence of the specified character sequence to this Appendable. |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [append](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#append(java.lang.CharSequence))([CharSequence](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/CharSequence.html) s) Appends the specified character sequence to this Appendable. |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [appendCodePoint](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#appendCodePoint(int))(int codePoint) |
| int | [capacity](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#capacity())() |
| char | [charAt](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#charAt(int))(int i) Returns the `char` value at the specified index. |
| int | [codePointAt](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#codePointAt(int))(int i) |
| int | [codePointBefore](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#codePointBefore(int))(int i) |
| int | [codePointCount](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#codePointCount(int,%20int))(int i, int j) |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [delete](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#delete(int,%20int))(int start, int end) |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [deleteCharAt](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#deleteCharAt(int))(int index) |
| void | [ensureCapacity](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#ensureCapacity(int))(int i) |
| void | [getChars](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#getChars(int,%20int,%20char[],%20int))(int i, int j, char\[\] buf, int k) |
| int | [indexOf](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#indexOf(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) s) |
| int | [indexOf](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#indexOf(java.lang.String,%20int))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) s, int i) |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [insert](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#insert(int,%20char[]))(int offset, char\[\] str) |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [insert](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#insert(int,%20float))(int offset, float f) |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [insert](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#insert(int,%20java.lang.CharSequence))(int dstOffset, [CharSequence](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/CharSequence.html) s) |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [insert](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#insert(int,%20char))(int offset, char c) |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [insert](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#insert(int,%20long))(int offset, long l) |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [insert](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#insert(int,%20char[],%20int,%20int))(int index, char\[\] str, int offset, int len) |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [insert](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#insert(int,%20int))(int offset, int i) |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [insert](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#insert(int,%20java.lang.String))(int offset, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) str) |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [insert](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#insert(int,%20double))(int offset, double d) |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [insert](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#insert(int,%20java.lang.CharSequence,%20int,%20int))(int dstOffset, [CharSequence](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/CharSequence.html) s, int start, int end) |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [insert](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#insert(int,%20java.lang.Object))(int offset, [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [insert](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#insert(int,%20boolean))(int offset, boolean b) |
| int | [lastIndexOf](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#lastIndexOf(java.lang.String,%20int))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) s, int i) |
| int | [lastIndexOf](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#lastIndexOf(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) s) |
| int | [length](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#length())() Returns the length of this character sequence. |
| int | [offsetByCodePoints](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#offsetByCodePoints(int,%20int))(int i, int j) |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [replace](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#replace(int,%20int,%20java.lang.String))(int start, int end, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) str) |
| [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html) | [reverse](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#reverse())() |
| void | [setCharAt](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#setCharAt(int,%20char))(int i, char c) |
| void | [setLength](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#setLength(int))(int i) |
| [CharSequence](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/CharSequence.html) | [subSequence](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#subSequence(int,%20int))(int i, int j) Returns a `CharSequence` that is a subsequence of this sequence. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [substring](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#substring(int,%20int))(int i, int j) |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [substring](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#substring(int))(int i) |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| void | [trimToSize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html#trimToSize())() |

### Inherited Method Summary

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

From interface [java.lang.Appendable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Appendable.html)

|---|---|
| abstract [Appendable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Appendable.html) | [append](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Appendable.html#append(char))(char c) Appends the specified character to this Appendable. |
| abstract [Appendable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Appendable.html) | [append](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Appendable.html#append(java.lang.CharSequence,%20int,%20int))([CharSequence](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/CharSequence.html) csq, int start, int end) Appends a subsequence of the specified character sequence to this Appendable. |
| abstract [Appendable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Appendable.html) | [append](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Appendable.html#append(java.lang.CharSequence))([CharSequence](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/CharSequence.html) csq) Appends the specified character sequence to this Appendable. |

From interface [java.lang.CharSequence](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/CharSequence.html)

|---|---|
| abstract char | [charAt](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/CharSequence.html#charAt(int))(int index) Returns the `char` value at the specified index. |
| [IntStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/stream/IntStream.html) | [chars](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/CharSequence.html#chars())() Returns a stream of `int` zero-extending the `char` values from this sequence. |
| [IntStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/stream/IntStream.html) | [codePoints](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/CharSequence.html#codePoints())() Returns a stream of code point values from this sequence. |
| abstract int | [length](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/CharSequence.html#length())() Returns the length of this character sequence. |
| abstract [CharSequence](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/CharSequence.html) | [subSequence](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/CharSequence.html#subSequence(int,%20int))(int start, int end) Returns a `CharSequence` that is a subsequence of this sequence. |
| abstract [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/CharSequence.html#toString())() Returns a string containing the characters in this sequence in the same order as this sequence. |

## Public Constructors

#### public
**StringBuilder**
()

Constructs a string builder with no characters in it and an
initial capacity of 16 characters.

#### public
**StringBuilder**
(int capacity)

Constructs a string builder with no characters in it and an
initial capacity specified by the `capacity` argument.

##### Parameters

| capacity | the initial capacity. |
|---|---|

##### Throws

| [NegativeArraySizeException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NegativeArraySizeException.html) | if the `capacity` argument is less than `0`. |
|---|---|

#### public
**StringBuilder**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) str)

Constructs a string builder initialized to the contents of the
specified string. The initial capacity of the string builder is
`16` plus the length of the string argument.

##### Parameters

| str | the initial contents of the buffer. |
|---|---|

#### public
**StringBuilder**
([CharSequence](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/CharSequence.html) seq)

Constructs a string builder that contains the same characters
as the specified `CharSequence`. The initial capacity of
the string builder is `16` plus the length of the
`CharSequence` argument.

##### Parameters

| seq | the sequence to copy. |
|---|---|

## Public Methods

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**append**
(boolean b)

<br />

##### Parameters

| b |   |
|---|---|

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**append**
(long lng)

<br />

##### Parameters

| lng |   |
|---|---|

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**append**
(char c)

Appends the specified character to this Appendable.

##### Parameters

| c | The character to append |
|---|---|

##### Returns

- A reference to this Appendable

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**append**
([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj)

<br />

##### Parameters

| obj |   |
|---|---|

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**append**
(char\[\] str, int offset, int len)

<br />

##### Parameters

| str |   |
| offset |   |
| len |   |
|---|---|

##### Throws

| [IndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IndexOutOfBoundsException.html) |   |
|---|---|

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**append**
(double d)

<br />

##### Parameters

| d |   |
|---|---|

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**append**
(char\[\] str)

<br />

##### Parameters

| str |   |
|---|---|

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**append**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) str)

<br />

##### Parameters

| str |   |
|---|---|

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**append**
([StringBuffer](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuffer.html) sb)

Appends the specified `StringBuffer` to this sequence.


The characters of the `StringBuffer` argument are appended,
in order, to this sequence, increasing the
length of this sequence by the length of the argument.
If `sb` is `null`, then the four characters
`"null"` are appended to this sequence.


Let *n* be the length of this character sequence just prior to
execution of the `append` method. Then the character at index
*k* in the new character sequence is equal to the character at
index *k* in the old character sequence, if *k* is less than
*n*; otherwise, it is equal to the character at index *k-n*
in the argument `sb`.

##### Parameters

| sb | the `StringBuffer` to append. |
|---|---|

##### Returns

- a reference to this object.

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**append**
(float f)

<br />

##### Parameters

| f |   |
|---|---|

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**append**
(int i)

<br />

##### Parameters

| i |   |
|---|---|

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**append**
([CharSequence](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/CharSequence.html) s, int start, int end)

Appends a subsequence of the specified character sequence to this
Appendable.

An invocation of this method of the form out.append(csq, start, end) when csq is not null, behaves in
exactly the same way as the invocation

```
     out.append(csq.subSequence(start, end)) 
```

<br />

##### Parameters

| s | The character sequence from which a subsequence will be appended. If csq is null, then characters will be appended as if csq contained the four characters "null". |
| start | The index of the first character in the subsequence |
| end | The index of the character following the last character in the subsequence |
|---|---|

##### Returns

- A reference to this Appendable

##### Throws

| [IndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IndexOutOfBoundsException.html) |   |
|---|---|

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**append**
([CharSequence](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/CharSequence.html) s)

Appends the specified character sequence to this Appendable.

Depending on which class implements the character sequence
csq, the entire sequence may not be appended. For
instance, if csq is a `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/CharBuffer.html` then
the subsequence to append is defined by the buffer's position and limit.

##### Parameters

| s | The character sequence to append. If csq is null, then the four characters "null" are appended to this Appendable. |
|---|---|

##### Returns

- A reference to this Appendable

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**appendCodePoint**
(int codePoint)

<br />

##### Parameters

| codePoint |   |
|---|---|

#### public int
**capacity**
()

<br />

#### public char
**charAt**
(int i)

Returns the `char` value at the specified index. An index ranges from zero
to length() - 1. The first `char` value of the sequence is at
index zero, the next at index one, and so on, as for array
indexing.

If the `char` value specified by the index is a
[surrogate](https://developers.google.com/j2objc/javadoc/jre//java/lang/Character.html#unicode), the surrogate
value is returned.

##### Parameters

| i | the index of the `char` value to be returned |
|---|---|

##### Returns

- the specified `char` value

#### public int
**codePointAt**
(int i)

<br />

##### Parameters

| i |   |
|---|---|

#### public int
**codePointBefore**
(int i)

<br />

##### Parameters

| i |   |
|---|---|

#### public int
**codePointCount**
(int i, int j)

<br />

##### Parameters

| i |   |
| j |   |
|---|---|

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**delete**
(int start, int end)

<br />

##### Parameters

| start |   |
| end |   |
|---|---|

##### Throws

| [StringIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringIndexOutOfBoundsException.html) |   |
|---|---|

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**deleteCharAt**
(int index)

<br />

##### Parameters

| index |   |
|---|---|

##### Throws

| [StringIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringIndexOutOfBoundsException.html) |   |
|---|---|

#### public void
**ensureCapacity**
(int i)

<br />

##### Parameters

| i |   |
|---|---|

#### public void
**getChars**
(int i, int j, char\[\] buf, int k)

<br />

##### Parameters

| i |   |
| j |   |
| buf |   |
| k |   |
|---|---|

#### public int
**indexOf**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) s)

<br />

##### Parameters

| s |   |
|---|---|

#### public int
**indexOf**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) s, int i)

<br />

##### Parameters

| s |   |
| i |   |
|---|---|

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**insert**
(int offset, char\[\] str)

<br />

##### Parameters

| offset |   |
| str |   |
|---|---|

##### Throws

| [StringIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringIndexOutOfBoundsException.html) |   |
|---|---|

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**insert**
(int offset, float f)

<br />

##### Parameters

| offset |   |
| f |   |
|---|---|

##### Throws

| [StringIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringIndexOutOfBoundsException.html) |   |
|---|---|

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**insert**
(int dstOffset, [CharSequence](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/CharSequence.html) s)

<br />

##### Parameters

| dstOffset |   |
| s |   |
|---|---|

##### Throws

| [IndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IndexOutOfBoundsException.html) |   |
|---|---|

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**insert**
(int offset, char c)

<br />

##### Parameters

| offset |   |
| c |   |
|---|---|

##### Throws

| [IndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IndexOutOfBoundsException.html) |   |
|---|---|

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**insert**
(int offset, long l)

<br />

##### Parameters

| offset |   |
| l |   |
|---|---|

##### Throws

| [StringIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringIndexOutOfBoundsException.html) |   |
|---|---|

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**insert**
(int index, char\[\] str, int offset, int len)

<br />

##### Parameters

| index |   |
| str |   |
| offset |   |
| len |   |
|---|---|

##### Throws

| [StringIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringIndexOutOfBoundsException.html) |   |
|---|---|

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**insert**
(int offset, int i)

<br />

##### Parameters

| offset |   |
| i |   |
|---|---|

##### Throws

| [StringIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringIndexOutOfBoundsException.html) |   |
|---|---|

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**insert**
(int offset, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) str)

<br />

##### Parameters

| offset |   |
| str |   |
|---|---|

##### Throws

| [StringIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringIndexOutOfBoundsException.html) |   |
|---|---|

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**insert**
(int offset, double d)

<br />

##### Parameters

| offset |   |
| d |   |
|---|---|

##### Throws

| [StringIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringIndexOutOfBoundsException.html) |   |
|---|---|

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**insert**
(int dstOffset, [CharSequence](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/CharSequence.html) s, int start, int end)

<br />

##### Parameters

| dstOffset |   |
| s |   |
| start |   |
| end |   |
|---|---|

##### Throws

| [IndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IndexOutOfBoundsException.html) |   |
|---|---|

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**insert**
(int offset, [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj)

<br />

##### Parameters

| offset |   |
| obj |   |
|---|---|

##### Throws

| [StringIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringIndexOutOfBoundsException.html) |   |
|---|---|

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**insert**
(int offset, boolean b)

<br />

##### Parameters

| offset |   |
| b |   |
|---|---|

##### Throws

| [StringIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringIndexOutOfBoundsException.html) |   |
|---|---|

#### public int
**lastIndexOf**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) s, int i)

<br />

##### Parameters

| s |   |
| i |   |
|---|---|

#### public int
**lastIndexOf**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) s)

<br />

##### Parameters

| s |   |
|---|---|

#### public int
**length**
()

Returns the length of this character sequence. The length is the number
of 16-bit `char`s in the sequence.

##### Returns

- the number of `char`s in this sequence

#### public int
**offsetByCodePoints**
(int i, int j)

<br />

##### Parameters

| i |   |
| j |   |
|---|---|

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**replace**
(int start, int end, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) str)

<br />

##### Parameters

| start |   |
| end |   |
| str |   |
|---|---|

##### Throws

| [StringIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringIndexOutOfBoundsException.html) |   |
|---|---|

#### public [StringBuilder](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringBuilder.html)
**reverse**
()

<br />

#### public void
**setCharAt**
(int i, char c)

<br />

##### Parameters

| i |   |
| c |   |
|---|---|

#### public void
**setLength**
(int i)

<br />

##### Parameters

| i |   |
|---|---|

#### public [CharSequence](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/CharSequence.html)
**subSequence**
(int i, int j)

Returns a `CharSequence` that is a subsequence of this sequence.
The subsequence starts with the `char` value at the specified index and
ends with the `char` value at index end - 1. The length
(in `char`s) of the
returned sequence is end - start, so if start == end
then an empty sequence is returned.

##### Parameters

| i | the start index, inclusive |
| j | the end index, exclusive |
|---|---|

##### Returns

- the specified subsequence

#### public [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)
**substring**
(int i, int j)

<br />

##### Parameters

| i |   |
| j |   |
|---|---|

#### public [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)
**substring**
(int i)

<br />

##### Parameters

| i |   |
|---|---|

#### public [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)
**toString**
()

Returns a string containing a concise, human-readable description of this
object. Subclasses are encouraged to override this method and provide an
implementation that takes into account the object's type and data. The
default implementation is equivalent to the following expression:

```
   getClass().getName() + '@' + Integer.toHexString(hashCode())
```

See [Writing a useful
`toString` method](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#writing_toString)
if you intend implementing your own `toString` method.

##### Returns

- a printable representation of this object.

#### public void
**trimToSize**
()

<br />