Use the append method of the StringBuffer class to convert other Java type data into strings and then append them to the StringBuffer object.
Appends a string object to the current StringBuffer object and returns a reference to the current StringBuffer object.
Convert an int type data into a string object and then append it to the current StringBuffer object, and return a reference to the current StringBuffer object.
Appends the string representation of an Object object o to the current String-Buffer object and returns a reference to the current StringBuffer object.
StringBuffer append(long n), StringBuffer append(boolean n), StringBuffer append(float n), StringBuffer append(double n) and StringBuffer append(char n).
Get a single character at the position specified by parameter n. The first position of the string sequence in the current object entity is 0, the second position is 1, and so on. The value of n must be non-negative and less than the length of the string sequence in the current object entity.
Replace the character at string position n in the current StringBuffer object entity with the character specified by parameter ch. The value of n must be non-negative and less than the length of the string sequence in the current object entity.
The StringBuffer object uses the insert method to insert the string specified by the parameter str into the position specified by the parameter index, and returns a reference to the current object.
The StringBuffer object uses the reverse() method to flip the characters in the object entity and return a reference to the current object.
delete(int startIndex, int endIndex) deletes a substring from the string in the current StringBuffer object entity and returns a reference to the current object. Here startIndex specifies the index of the first character that needs to be deleted, and endIndex specifies the index of the next character after the last character that needs to be deleted. Therefore, the substring to be deleted is from startIndex to endIndex-1. The deleteCharAt(int index) method deletes a character at the index position in the string of the current StringBuffer object entity.
The replace(int startIndex, int endIndex, String str) method replaces a substring of the string in the current StringBuffer object entity with the string specified by the parameter str. The replaced substring is specified by the subscripts startIndex and endIndex, that is, the string from startIndex to endIndex-1 is replaced. This method returns a reference to the current StringBuffer object.