StringBuffer介绍
A string buffer is like a String, but can be modified.一个类似于 String 的字符串缓冲区,但可以修改
(可变的字符序列)
StringBuffer 常用方法:
1.public StringBuffer append(...);Appends the string representation of the #?# argument
to the sequence.
将参数的字符串表示形式追加到此序列。
2.public StringBuffer insert(int offSet,E e)
在指定的位置上插入元素
3.public String delete(int start,int end);
Removes the characters in a substring of this sequence.
移除此序列的子字符串中的字符。
4.public StringBuffer reverse();
Causes this character sequence to be replaced by
the reverse of the sequence.
将此字符序列用其反转形式取代。
StringBuffer作为可变的字符序列,在编程中扮演着关键角色。本文详细介绍了StringBuffer的基本概念及其常用方法,包括如何追加、插入、删除和反转字符串。通过实例解析,帮助开发者更好地掌握StringBuffer的使用技巧。
953

被折叠的 条评论
为什么被折叠?



