看一下api啊,delete,replace,都可以 delete public StringBuffer delete(int start, int end)Removes the characters in a substring of this sequence. The substring begins at the specified start and extends to the character at index end - 1 or to the end of the sequence if no such character exists. If start is equal to end, no changes are made. replace public StringBuffer replace(int start, int end, String str)Replaces the characters in a substring of this sequence with characters in the specified String. The substring begins at the specified start and extends to the character at index end - 1 or to the end of the sequence if no such character exists. First the characters in the substring are removed and then the specified String is inserted at start. (This sequence will be lengthened to accommodate the specified String if necessary.)
java.util.Arrays.fill(data,null);
java.util.Arrays.fill(data,"");
使用了有,怎样将其中的数据清除?以免影响下一次的使用,
快帮帮我啊,急啊!
但我现在遇到了StringBuffer strbuff=new StringBuffer();问题了,
我第一次使用strbuff了,但我第二次使时,前一次的数据还在啊,
怎样才能将前一次的数据清空呢?快帮帮忙啊?
delete
public StringBuffer delete(int start,
int end)Removes the characters in a substring of this sequence. The substring begins at the specified start and extends to the character at index end - 1 or to the end of the sequence if no such character exists. If start is equal to end, no changes are made. replace
public StringBuffer replace(int start,
int end,
String str)Replaces the characters in a substring of this sequence with characters in the specified String. The substring begins at the specified start and extends to the character at index end - 1 or to the end of the sequence if no such character exists. First the characters in the substring are removed and then the specified String is inserted at start. (This sequence will be lengthened to accommodate the specified String if necessary.)