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).
另外,只有setLength()阿,好像都不行
if(sb.length()>0)
sb.delete(0,sb.length());
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).