Deprecated
As of 3.6, use Apache Commons Text TextStringBuilder.
The main differences from StringBuffer/StringBuilder are:
The aim has been to provide an API that mimics very closely what StringBuffer
provides, but with additional methods. It should be noted that some edge cases,
with invalid indices or null input, have been altered - see individual methods.
The biggest of these changes is that by default, null will not output the text
'null'. This can be controlled by a property, setNullText(String).
Prior to 3.0, this class implemented Cloneable but did not implement the clone method so could not be used. From 3.0 onwards it no longer implements the interface.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv class | StrBuilder.
Inner class to allow StrBuilder to operate as a reader. |
| pack-priv class | StrBuilder.
References Deprecated
Inner class to allow StrBuilder to operate as a tokenizer.
StrTokenizer is deprecated or references (maybe indirectly) at least one deprecated element.
|
| pack-priv class | StrBuilder.
Inner class to allow StrBuilder to operate as a writer. |
| Modifier and Type | Field and Description |
|---|---|
| protected char[] | buffer
Internal data storage. |
| pack-priv static final int | CAPACITY
The extra capacity for new builders. |
| private String | newLine
The new line, |
| private String | nullText
The null text. |
| private static final long | serialVersionUID
Required for serialization support. |
| protected int | size
Current size of the buffer. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | StrBuilder(int
the initial capacity, zero or less will be converted to 32 initialCapacity)Constructor that creates an empty builder the specified initial capacity. |
| public | StrBuilder(final String
the string to copy, null treated as blank string str)Constructor that creates a builder from the string, allocating 32 extra characters for growth. |
| Modifier and Type | Method and Description |
|---|---|
| public StrBuilder | Returns: this, to enable chainingthe value to append value)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends a boolean value to the string builder. |
| public StrBuilder | Returns: this, to enable chainingthe value to append ch)Implements java.
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends a char value to the string builder. |
| public StrBuilder | Returns: this, to enable chainingthe char array to append chars)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends a char array to the string builder. |
| public StrBuilder | Returns: this, to enable chainingthe char array to append chars, final int the start index, inclusive, must be valid startIndex, final int the length to append, must be valid length)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends a char array to the string builder. |
| public StrBuilder | Returns: this, to enable chainingthe char buffer to append buf)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends the contents of a char buffer to this string builder. |
| public StrBuilder | Returns: this, to enable chainingthe char buffer to append buf, final int the start index, inclusive, must be valid startIndex, final int the length to append, must be valid length)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends the contents of a char buffer to this string builder. |
| public StrBuilder | Returns: this, to enable chainingthe CharSequence to append seq)Implements java.
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends a CharSequence to this string builder. |
| public StrBuilder | Returns: this, to enable chainingthe CharSequence to append seq, final int the start index, inclusive, must be valid startIndex, final int the length to append, must be valid length)Implements java.
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends part of a CharSequence to this string builder. |
| public StrBuilder | Returns: this, to enable chainingthe value to append value)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends a double value to the string builder using |
| public StrBuilder | Returns: this, to enable chainingthe value to append value)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends a float value to the string builder using |
| public StrBuilder | Returns: this, to enable chainingthe value to append value)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends an int value to the string builder using |
| public StrBuilder | Returns: this, to enable chainingthe value to append value)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends a long value to the string builder using |
| public StrBuilder | Returns: this, to enable chainingthe object to append obj)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends an object to this string builder. |
| public StrBuilder | Returns: this, to enable chainingthe string builder to append str)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends another string builder to this string builder. |
| public StrBuilder | Returns: this, to enable chainingthe string to append str, final int the start index, inclusive, must be valid startIndex, final int the length to append, must be valid length)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends part of a string builder to this string builder. |
| public StrBuilder | Returns: this, to enable chainingthe string to append str)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends a string to this string builder. |
| public StrBuilder | Returns: this, to enable chainingthe string to append str, final int the start index, inclusive, must be valid startIndex, final int the length to append, must be valid length)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends part of a string to this string builder. |
| public StrBuilder | Returns: this to enable chainingthe format string format, final Object... the objects to use in the format string objs)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Calls |
| public StrBuilder | Returns: this, to enable chainingthe string buffer to append str)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends a string buffer to this string builder. |
| public StrBuilder | Returns: this, to enable chainingthe string to append str, final int the start index, inclusive, must be valid startIndex, final int the length to append, must be valid length)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends part of a string buffer to this string builder. |
| public StrBuilder | Returns: this, to enable chainingthe StringBuilder to append str)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends a StringBuilder to this string builder. |
| public StrBuilder | Returns: this, to enable chainingthe StringBuilder to append str, final int the start index, inclusive, must be valid startIndex, final int the length to append, must be valid length)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends part of a StringBuilder to this string builder. |
| public StrBuilder | Returns: this, to enable chainingthe iterable to append iterable)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends each item in an iterable to the builder without any separators. |
| public StrBuilder | Returns: this, to enable chainingthe iterator to append it)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends each item in an iterator to the builder without any separators. |
| public < the element type T> StrBuilder | Returns: this, to enable chainingthe array to append array)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends each item in an array to the builder without any separators. |
| public StrBuilder | Returns: this, to enable chainingthe value to append value, final int the fixed field width, zero or negative has no effect width, final char the pad character to use padChar)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends an object to the builder padding on the left to a fixed width. |
| public StrBuilder | Returns: this, to enable chainingthe object to append, null uses null text obj, final int the fixed field width, zero or negative has no effect width, final char the pad character to use padChar)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends an object to the builder padding on the left to a fixed width. |
| public StrBuilder | Returns: this, to enable chainingthe value to append value, final int the fixed field width, zero or negative has no effect width, final char the pad character to use padChar)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends an object to the builder padding on the right to a fixed length. |
| public StrBuilder | Returns: this, to enable chainingthe object to append, null uses null text obj, final int the fixed field width, zero or negative has no effect width, final char the pad character to use padChar)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends an object to the builder padding on the right to a fixed length. |
| public StrBuilder | Returns: this, to enable chainingthe value to append value)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends a boolean value followed by a new line to the string builder. |
| public StrBuilder | Returns: this, to enable chainingthe value to append ch)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends a char value followed by a new line to the string builder. |
| public StrBuilder | Returns: this, to enable chainingthe char array to append chars)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends a char array followed by a new line to the string builder. |
| public StrBuilder | Returns: this, to enable chainingthe char array to append chars, final int the start index, inclusive, must be valid startIndex, final int the length to append, must be valid length)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends a char array followed by a new line to the string builder. |
| public StrBuilder | Returns: this, to enable chainingthe value to append value)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends a double value followed by a new line to the string builder using |
| public StrBuilder | Returns: this, to enable chainingthe value to append value)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends a float value followed by a new line to the string builder using |
| public StrBuilder | Returns: this, to enable chainingthe value to append value)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends an int value followed by a new line to the string builder using |
| public StrBuilder | Returns: this, to enable chainingthe value to append value)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends a long value followed by a new line to the string builder using |
| public StrBuilder | Returns: this, to enable chainingthe object to append obj)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends an object followed by a new line to this string builder. |
| public StrBuilder | Returns: this, to enable chainingthe string builder to append str)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends another string builder followed by a new line to this string builder. |
| public StrBuilder | Returns: this, to enable chainingthe string to append str, final int the start index, inclusive, must be valid startIndex, final int the length to append, must be valid length)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends part of a string builder followed by a new line to this string builder. |
| public StrBuilder | Returns: this, to enable chainingthe string to append str)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends a string followed by a new line to this string builder. |
| public StrBuilder | Returns: this, to enable chainingthe string to append str, final int the start index, inclusive, must be valid startIndex, final int the length to append, must be valid length)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends part of a string followed by a new line to this string builder. |
| public StrBuilder | Returns: this to enable chainingthe format string format, final Object... the objects to use in the format string objs)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Calls |
| public StrBuilder | Returns: this, to enable chainingthe string buffer to append str)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends a string buffer followed by a new line to this string builder. |
| public StrBuilder | Returns: this, to enable chainingthe string to append str, final int the start index, inclusive, must be valid startIndex, final int the length to append, must be valid length)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends part of a string buffer followed by a new line to this string builder. |
| public StrBuilder | Returns: this, to enable chainingthe string builder to append str)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends a string builder followed by a new line to this string builder. |
| public StrBuilder | Returns: this, to enable chainingthe string builder to append str, final int the start index, inclusive, must be valid startIndex, final int the length to append, must be valid length)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends part of a string builder followed by a new line to this string builder. |
| public StrBuilder | Returns: this instance.
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends this builder's new line string to this builder. |
| public StrBuilder | Returns: this, to enable chaining
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends the text representing |
| public StrBuilder | Returns: this, to enable chainingthe length to append, negative means no append length, final char the character to append padChar)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends the pad character to the builder the specified number of times. |
| public StrBuilder | Returns: this, to enable chainingthe separator to use separator)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends a separator if the builder is currently non-empty. |
| public StrBuilder | Returns: this, to enable chainingthe separator if builder is not empty standard, final char the separator if builder is empty defaultIfEmpty)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Append one of both separators to the builder
If the builder is currently empty it will append the defaultIfEmpty-separator
Otherwise it will append the standard-separator
The separator is appended using |
| public StrBuilder | Returns: this, to enable chainingthe separator to use separator, final int the loop index loopIndex)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends a separator to the builder if the loop index is greater than zero. |
| public StrBuilder | Returns: this, to enable chainingthe separator to use, null means no separator separator)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends a separator if the builder is currently non-empty. |
| public StrBuilder | Returns: this, to enable chainingthe separator to use, null means no separator separator, final int the loop index loopIndex)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends a separator to the builder if the loop index is greater than zero. |
| public StrBuilder | Returns: this, to enable chainingthe separator if builder is not empty, null means no separator standard, final String the separator if builder is empty, null means no separator defaultIfEmpty)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends one of both separators to the StrBuilder. |
| public void | appendTo(final Appendable
the appendable to append data to appendable)Appends current contents of this |
| public StrBuilder | Returns: this, to enable chainingthe iterable to append iterable, final String the separator to use, null means no separator separator)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends an iterable placing separators between each value, but not before the first or after the last. |
| public StrBuilder | Returns: this, to enable chainingthe iterator to append it, final String the separator to use, null means no separator separator)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends an iterator placing separators between each value, but not before the first or after the last. |
| public StrBuilder | Returns: this, to enable chainingthe array to append array, final String the separator to use, null means no separator separator)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Appends an array placing separators between each value, but not before the first or after the last. |
| public Reader | Returns: a reader that reads from this builderGets the contents of this builder as a Reader. |
| public StrTokenizer | Returns: a tokenizer that is linked to this builder
References Deprecated
StrTokenizer is deprecated or references (maybe indirectly) at least one deprecated element.
Creates a tokenizer that can tokenize the contents of this builder. |
| public Writer | Returns: a writer that populates this builderGets this builder as a Writer that can be written to. |
| public String | Returns: the builder as a StringImplements org. Implement the |
| public int | |
| public char | Returns: the character at the indexthe index to retrieve, must be valid index)Implements java. Gets the character at the specified index. |
| public StrBuilder | Returns: this, to enable chaining
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Clears the string builder (convenience Collections API style method). |
| public boolean | Returns: true if the builder contains the characterthe character to find ch)Checks if the string builder contains the specified char. |
| public boolean | |
| public boolean | Returns: true if the matcher finds a match in the builderthe matcher to use, null returns -1 matcher)
References Deprecated
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
Checks if the string builder contains a string matched using the specified matcher. |
| public StrBuilder | Returns: this, to enable chainingthe start index, inclusive, must be valid startIndex, int the end index, exclusive, must be valid except
that if too large it is treated as end of string endIndex)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Deletes the characters between the two specified indices. |
| public StrBuilder | Returns: this, to enable chainingthe character to delete ch)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Deletes the character wherever it occurs in the builder. |
| public StrBuilder | Returns: this, to enable chainingthe string to delete, null causes no action str)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Deletes the string wherever it occurs in the builder. |
| public StrBuilder | Returns: this, to enable chainingthe matcher to use to find the deletion, null causes no action matcher)
References Deprecated
StrMatcher and StrBuilder are deprecated or reference (maybe indirectly) at least one deprecated element.
Deletes all parts of the builder that the matcher matches. |
| public StrBuilder | Returns: this, to enable chainingthe index to delete index)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Deletes the character at the specified index. |
| public StrBuilder | Returns: this, to enable chainingthe character to delete ch)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Deletes the character wherever it occurs in the builder. |
| public StrBuilder | Returns: this, to enable chainingthe string to delete, null causes no action str)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Deletes the string wherever it occurs in the builder. |
| public StrBuilder | Returns: this, to enable chainingthe matcher to use to find the deletion, null causes no action matcher)
References Deprecated
StrMatcher and StrBuilder are deprecated or reference (maybe indirectly) at least one deprecated element.
Deletes the first match within the builder using the specified matcher. |
| private void | deleteImpl(final int
the start index, must be valid startIndex, final int the end index (exclusive), must be valid endIndex, final int the length, must be valid len)Internal method to delete a range without validation. |
| public boolean | |
| public StrBuilder | Returns: this, to enable chainingthe capacity to ensure capacity)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Checks the capacity and ensures that it is at least the size specified. |
| public boolean | Returns: true if the builders contain the same characters in the same orderthe object to check, null returns false obj)Overrides java. Checks the contents of this builder against another to see if they contain the same character content. |
| public boolean | Returns: true if the builders contain the same characters in the same orderthe object to check, null returns false other)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Checks the contents of this builder against another to see if they contain the same character content. |
| public boolean | Returns: true if the builders contain the same characters in the same orderthe object to check, null returns false other)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Checks the contents of this builder against another to see if they contain the same character content ignoring case. |
| public char[] | Returns: the input array, unless that was null or too smallthe destination array, null will cause an array to be created destination)Copies the character array into the specified array. |
| public void | getChars(final int
first index to copy, inclusive, must be valid startIndex, final int last index, exclusive, must be valid endIndex, final char[] the destination array, must not be null or too small destination, final int the index to start copying in destination destinationIndex)Overrides default java. Copies the character array into the specified array. |
| public String | |
| public String | Returns: the null text, null means no appendGets the text to be appended when null is added. |
| public int | Returns: a hash codeOverrides java. Gets a suitable hash code for this builder. |
| public int | Returns: the first index of the character, or -1 if not foundthe character to find ch)Searches the string builder to find the first reference to the specified char. |
| public int | Returns: the first index of the character, or -1 if not foundthe character to find ch, int the index to start at, invalid index rounded to edge startIndex)Searches the string builder to find the first reference to the specified char. |
| public int | |
| public int | Returns: the first index of the string, or -1 if not foundthe string to find, null returns -1 str, final int the index to start at, invalid index rounded to edge startIndex)Searches the string builder to find the first reference to the specified string starting searching from the given index. |
| public int | Returns: the first index matched, or -1 if not foundthe matcher to use, null returns -1 matcher)
References Deprecated
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
Searches the string builder using the matcher to find the first match. |
| public int | Returns: the first index matched, or -1 if not foundthe matcher to use, null returns -1 matcher, int the index to start at, invalid index rounded to edge startIndex)
References Deprecated
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
Searches the string builder using the matcher to find the first match searching from the given index. |
| public StrBuilder | Returns: this, to enable chainingthe index to add at, must be valid index, final boolean the value to insert value)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Inserts the value into this builder. |
| public StrBuilder | Returns: this, to enable chainingthe index to add at, must be valid index, final char the value to insert value)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Inserts the value into this builder. |
| public StrBuilder | Returns: this, to enable chainingthe index to add at, must be valid index, final char[] the char array to insert chars)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Inserts the character array into this builder. |
| public StrBuilder | Returns: this, to enable chainingthe index to add at, must be valid index, final char[] the char array to insert chars, final int the offset into the character array to start at, must be valid offset, final int the length of the character array part to copy, must be positive length)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Inserts part of the character array into this builder. |
| public StrBuilder | Returns: this, to enable chainingthe index to add at, must be valid index, final double the value to insert value)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Inserts the value into this builder. |
| public StrBuilder | Returns: this, to enable chainingthe index to add at, must be valid index, final float the value to insert value)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Inserts the value into this builder. |
| public StrBuilder | Returns: this, to enable chainingthe index to add at, must be valid index, final int the value to insert value)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Inserts the value into this builder. |
| public StrBuilder | Returns: this, to enable chainingthe index to add at, must be valid index, final long the value to insert value)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Inserts the value into this builder. |
| public StrBuilder | Returns: this, to enable chainingthe index to add at, must be valid index, final Object the object to insert obj)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Inserts the string representation of an object into this builder. |
| public StrBuilder | Returns: this, to enable chainingthe index to add at, must be valid index, String the string to insert str)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Inserts the string into this builder. |
| public boolean | Returns: true if the size is 0.Overrides default java. Checks is the string builder is empty (convenience Collections API style method). |
| public boolean | Returns: true if the size is greater than 0.Checks is the string builder is not empty (convenience Collections API style method). |
| public int | Returns: the last index of the character, or -1 if not foundthe character to find ch)Searches the string builder to find the last reference to the specified char. |
| public int | Returns: the last index of the character, or -1 if not foundthe character to find ch, int the index to start at, invalid index rounded to edge startIndex)Searches the string builder to find the last reference to the specified char. |
| public int | Returns: the last index of the string, or -1 if not foundthe string to find, null returns -1 str)Searches the string builder to find the last reference to the specified string. |
| public int | Returns: the last index of the string, or -1 if not foundthe string to find, null returns -1 str, final int the index to start at, invalid index rounded to edge startIndex)Searches the string builder to find the last reference to the specified string starting searching from the given index. |
| public int | Returns: the last index matched, or -1 if not foundthe matcher to use, null returns -1 matcher)
References Deprecated
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
Searches the string builder using the matcher to find the last match. |
| public int | Returns: the last index matched, or -1 if not foundthe matcher to use, null returns -1 matcher, int the index to start at, invalid index rounded to edge startIndex)
References Deprecated
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
Searches the string builder using the matcher to find the last match searching from the given index. |
| public String | Returns: the new stringthe number of characters to extract, negative returns empty string length)Extracts the leftmost characters from the string builder without throwing an exception. |
| public int | Returns: the lengthImplements java. Gets the length of the string builder. |
| public String | Returns: the new stringthe index to start at, negative means zero index, final int the number of characters to extract, negative returns empty string length)Extracts some characters from the middle of the string builder without throwing an exception. |
| public StrBuilder | Returns: this, to enable chaining
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Minimizes the capacity to the actual length of the string. |
| public int | |
| public StrBuilder | Returns: this, to enable chainingthe start index, inclusive, must be valid startIndex, int the end index, exclusive, must be valid except
that if too large it is treated as end of string endIndex, final String the string to replace with, null means delete range replaceStr)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Replaces a portion of the string builder with another string. |
| public StrBuilder | Returns: this, to enable chainingthe matcher to use to find the deletion, null causes no action matcher, final String the string to replace the match with, null is a delete replaceStr, final int the start index, inclusive, must be valid startIndex, int the end index, exclusive, must be valid except
that if too large it is treated as end of string endIndex, final int the number of times to replace, -1 for replace all replaceCount)
References Deprecated
StrMatcher and StrBuilder are deprecated or reference (maybe indirectly) at least one deprecated element.
Advanced search and replaces within the builder using a matcher. |
| public StrBuilder | Returns: this, to enable chainingthe search character search, final char the replace character replace)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Replaces the search character with the replace character throughout the builder. |
| public StrBuilder | Returns: this, to enable chainingthe search string, null causes no action to occur searchStr, final String the replace string, null is equivalent to an empty string replaceStr)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Replaces the search string with the replace string throughout the builder. |
| public StrBuilder | Returns: this, to enable chainingthe matcher to use to find the deletion, null causes no action matcher, final String the replace string, null is equivalent to an empty string replaceStr)
References Deprecated
StrMatcher and StrBuilder are deprecated or reference (maybe indirectly) at least one deprecated element.
Replaces all matches within the builder with the replace string. |
| public StrBuilder | Returns: this, to enable chainingthe search character search, final char the replace character replace)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Replaces the first instance of the search character with the replace character in the builder. |
| public StrBuilder | Returns: this, to enable chainingthe search string, null causes no action to occur searchStr, final String the replace string, null is equivalent to an empty string replaceStr)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Replaces the first instance of the search string with the replace string. |
| public StrBuilder | Returns: this, to enable chainingthe matcher to use to find the deletion, null causes no action matcher, final String the replace string, null is equivalent to an empty string replaceStr)
References Deprecated
StrMatcher and StrBuilder are deprecated or reference (maybe indirectly) at least one deprecated element.
Replaces the first match within the builder with the replace string. |
| private void | replaceImpl(final int
the start index, must be valid startIndex, final int the end index (exclusive), must be valid endIndex, final int the length to remove (endIndex - startIndex), must be valid removeLen, final String the string to replace with, null means delete range insertStr, final int the length of the insert string, must be valid insertLen)Internal method to delete a range without validation. |
| private StrBuilder | Returns: this, to enable chainingthe matcher to use to find the deletion, null causes no action matcher, final String the string to replace the match with, null is a delete replaceStr, final int the start index, must be valid from, int the end index (exclusive), must be valid to, int the number of times to replace, -1 for replace all replaceCount)
References Deprecated
StrMatcher and StrBuilder are deprecated or reference (maybe indirectly) at least one deprecated element.
Replaces within the builder using a matcher. |
| public StrBuilder | Returns: this, to enable chaining
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Reverses the string builder placing each character in the opposite index. |
| public String | Returns: the new stringthe number of characters to extract, negative returns empty string length)Extracts the rightmost characters from the string builder without throwing an exception. |
| public StrBuilder | Returns: this, to enable chainingthe index to set index, final char the new character ch)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Sets the character at the specified index. |
| public StrBuilder | Returns: this, to enable chainingthe length to set to, must be zero or positive length)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Updates the length of the builder by either dropping the last characters or adding filler of Unicode zero. |
| public StrBuilder | Returns: this instance.the new line text, newLine)null means use the system default from System#lineSeparator().
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Sets the text to be appended when |
| public StrBuilder | Returns: this, to enable chainingthe null text, null means no append nullText)
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Sets the text to be appended when null is added. |
| public int | |
| public boolean | Returns: true if the builder starts with the stringthe string to search for, null returns false str)Checks whether this builder starts with the specified string. |
| public CharSequence | subSequence(final int startIndex, final int endIndex)
Implements java. Returns a |
| public String | Returns: the new stringthe start index, inclusive, must be valid start)Extracts a portion of this string builder as a string. |
| public String | Returns: the new stringthe start index, inclusive, must be valid startIndex, int the end index, exclusive, must be valid except
that if too large it is treated as end of string endIndex)Extracts a portion of this string builder as a string. |
| public char[] | Returns: a new array that represents the contents of the builderCopies the builder's character array into a new character array. |
| public char[] | Returns: a new array that holds part of the contents of the builderthe start index, inclusive, must be valid startIndex, int the end index, exclusive, must be valid except that
if too large it is treated as end of string endIndex)Copies part of the builder's character array into a new character array. |
| public String | Returns: the builder as a StringOverrides java. Implements java. Gets a String version of the string builder, creating a new instance each time the method is called. |
| public StringBuffer | Returns: the builder as a StringBufferGets a StringBuffer version of the string builder, creating a new instance each time the method is called. |
| public StringBuilder | Returns: the builder as a StringBuilderGets a StringBuilder version of the string builder, creating a new instance each time the method is called. |
| public StrBuilder | Returns: this, to enable chaining
References Deprecated
StrBuilder is deprecated or references (maybe indirectly) at least one deprecated element.
Trims the builder by removing characters less than or equal to a space from the beginning and end. |
| protected void | validateIndex(final int
the index, must be valid index)Validates parameters defining a single index in the builder. |
| protected int | Returns: the new stringthe start index, inclusive, must be valid startIndex, int the end index, exclusive, must be valid except
that if too large it is treated as end of string endIndex)Validates parameters defining a range of the builder. |