提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
如何从StringBuffer删除所有值
public class Main { /** from * 时代Java - N o w J a v a . c o m **/ public static void main(String[] args) { StringBuffer sbf = new StringBuffer("Hello World!"); System.out.println("StringBuffer content: " + sbf) ; sbf.delete(0, sbf.length()); System.out.println("StringBuffer content after reset:" + sbf); } }