java.lang.Object | +--java.lang.StringBuffer
Constructor Summary | |
StringBuffer()
Constructs a string buffer with no characters in it and an initial capacity of 16 characters. |
|
StringBuffer(String str)
Constructs a string buffer so that it represents the same sequence of characters as the string argument; in other words, the initial contents of the string buffer is a copy of the argument string. |
Method Summary | |
StringBuffer |
append(String str)
Appends the string to this string buffer. |
char |
charAt(int index)
The specified character of the sequence currently represented by the string buffer, as indicated by the index argument,
is returned. |
StringBuffer |
delete(int start,
int end)
Removes the characters in a substring of this StringBuffer . |
StringBuffer |
deleteCharAt(int index)
Removes the character at the specified position in this StringBuffer (shortening the StringBuffer
by one character). |
StringBuffer |
insert(int offset,
String str)
Inserts the string into this string buffer. |
int |
length()
Returns the length (character count) of this string buffer. |
StringBuffer |
replace(int start,
int end,
String str)
Replaces the characters in a substring of this StringBuffer
with characters in the specified String . |
StringBuffer |
reverse()
The character sequence contained in this string buffer is replaced by the reverse of the sequence. |
void |
setCharAt(int index,
char ch)
The character at the specified index of this string buffer is set to ch . |
String |
substring(int start,
int end)
Returns a new String that contains a subsequence of
characters currently contained in this StringBuffer . |