#
String Buffer (String Maipulation) java.lang.StringBufferStringBuffer is a peer class of String that provides much of the functionality of strings.
String represents fixed-length, immutable character sequences while StringBuffer represents growable and writable character sequences.
#
Instantiatesimple
With fixed size (n)
With initial string (str)
#
Methods (s)length() - length of stringBuffer
capacity() - the total allocated capacity
append() - append text/number to the exisiting string
insert() - is used to insert text/ character at the sepcified index poition
reverse() - Reverse the string
delete() - delete sequence of character in range of start index to end-1 index
replace() - replace sequence of character in range of start index to end-1 index
appendCodePoint() - appends string represntation of the CodePoint argument
codePointAt() - returns the characters ASCII (unicode) at the index
charAt() - returns the character at index
getChars() - copies individual characters from begin to end into the char array from arrBegin index
indexOf() - returns the index of the first occurrence of subString str
lastIndexOf() - returns the index of the last occurrence of subString str
setCharAt() - replace character at the index
setlength() - change the length of stringBuffer
subSequence() - returns Char sequence in range of start index to end-1 index
subSting() - returns sub string in range of start index to end-1 index
toString() - returns a string representation of sequence
trimToSize() - reduce capacity of stringBuffer to length of string