Name
java.lang.StringBuffer
Synopsis
This class is a scaled-down version of the J2SE
StringBuffer
class. It creates an editable
concatenation of characters. Use the append()
and
insert()
methods to add characters to the middle
or end of the StringBuffer
. Utilize the
capacity()
and ensureCapacity()
methods to ensure that the size requirements of the buffer are
sufficient. The delete()
and
deleteCharAt()
methods can be used to remove
portions of the buffer. The reverse()
method will
replace the current string with a backward copy of itself.
public final classStringBuffer
{ // public constructors publicStringBuffer
(); publicStringBuffer
(int length); publicStringBuffer
(String str); // public instance methods public StringBufferappend
(boolean b); public synchronized StringBufferappend
(char c); public synchronized StringBufferappend
(char[] str); public synchronized StringBufferappend
(char[] str, int offset, int len); public StringBufferappend
(int i); public StringBufferappend
(long l); public synchronized StringBufferappend
(Object obj); public synchronized StringBufferappend
(String str); public intcapacity
(); public synchronized charcharAt
(int index); public synchronized StringBufferdelete
(int start, int end); public synchronized StringBufferdeleteCharAt
(int index); public synchronized voidensureCapacity
(int minimumCapacity); public synchronized voidgetChars
(int srcBegin, int srcEnd, char[] dst, int dstBegin); public StringBufferinsert
(int offset, boolean b); public synchronized ...
Get Wireless Java now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.