clear stringbuilder java

Java
 sbStr.delete(0,  sbStr.length());
Source

Also in Java: