stringBuilder.setLength(0);

Read more of this post