append() | Used to add text at the end of the existing text. | sb.append(String str); |
---|
length() | The length of a StringBuffer can be found by the length( ) method. | int len = sb.length(); |
---|
capacity() | the total allocated capacity can be found by the capacity( ) method. | int cap = sb.capacity();
|
---|
charAt() | This method returns the char value in this sequence at the specified index. | char ch = sb.charAt(int index);
|
---|
delete() | Deletes a sequence of characters from the invoking object. | sb.delete(int start, int end);
|
---|
deleteCharAt() | Deletes the character at the index specified by the loc. | sb.deleteCharAt(int index);
|
---|
ensureCapacity() | Ensures capacity is at least equal to the given minimum. | sb.ensureCapacity(int minimumCapacity);
|
---|
insert() | Inserts text at the specified index position. | sb.insert(int offset, String str);
|
---|
reverse() | Reverse the characters within a StringBuffer object. | sb.reverse();
|
---|
replace() | Replace one set of characters with another set inside a StringBuffer object. | sb.replace(int start, int end, String str);
|
---|
ensureCapacity() | Increases StringBuffer capacity to the specified value | void ensureCapacity(int capacity) |
---|
appendCodePoint(int codePoint) | Appends code point as a string to the sequence. | public StringBuffer appendCodePoint(int codePoint) |
---|
charAt(int index) | Returns the char at the specified index. | public char charAt(int index) |
---|
IntStream chars() | Returns a stream of int values from zero-extended chars in the sequence.. | public IntStream chars() |
---|
codePointAt() | Returns the character (Unicode code point) at the specified index. | public int codePointAt(int index) |
---|
codePointBefore() | Returns the Unicode code point before the given index. | public int codePointBefore(int index) |
---|
codePointCount() | Returns the count of Unicode code points in the specified text range. | public int codePointCount(int beginIndex, int endIndex) |
---|
IntStream codePoints() | Returns a stream of code points from the sequence. | public IntStream codePoints() |
---|
getChars() | Copies characters from the sequence into the destination array. | public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) |
---|
indexOf() | Returns the index of the first occurrence of the specified substring. | public int indexOf(String str) public int indexOf(String str, int fromIndex) |
---|
lastIndexOf() | Returns the index of the last occurrence of the specified substring. | public int lastIndexOf(String str) public int lastIndexOf(String str, int fromIndex) |
---|
offsetByCodePoints() | Returns the index offset by a specified number of code points from the given index.. | public int offsetByCodePoints(int index, int codePointOffset) |
---|
setCharAt() | In this method, the character at the specified index is set to ch. | public void setCharAt(int index, char ch) |
---|
setLength() | This method sets the length of the character sequence. | public void setLength(int newLength) |
---|
subSequence() | Returns index offset by given code points from the specified index. | public CharSequence subSequence(int start, int end) |
---|
substring() | Returns a new String containing a subsequence of this character sequence. | public String substring(int start) public String substring(int start,int end) |
---|
toString() | Returns a string representing the data in the sequence. | public String toString() |
---|
trimToSize() | Attempts to minimize storage used by the character sequence. | public void trimToSize() |
---|