I would just like to ask if this is a good way of clearing/emptying a StringBuilder? It is wrapped in a method and it is called several times, is this thread safe? Does this not consume a lot of memory? Would it be better if I created the StringBuilder outside of the method and in the class instead?
private void callMe(){
StringBuilder builder = new StringBuilder();
builder.delete(0, builder.length());
}
builder.append("some ID");
if (builder.toString().contains("some other ID"))
Show("Information")
else
Show("Invalid ID")