Test a stringbuffer for empty contents and how to clear?
843835Nov 14 2002 — edited Nov 15 2002Hi i have two questions.
1) How do i clear the contents of my stringbuffer.
buffer = new StringBuffer(); --> creates a new object I think. Is there a way to clear like buffer = "";
2) How to test if a stringbuffer is empty? I do this and it always thinks that its not empty.
buffer = new StringBuffer();
if(!buffer.equals("")){
//I always get here and should not
}
Thanks in advance. I dont see that there is an isEmpty() method either..