The StringBuffer is always been using for the String concatenation. However this class didn’t provide a method to clear the existing content. Why there are no clear() function? You can use the delete(int start, int end) as dirty trick : sb.delete(0, sb.length()); 1 . Example package com.mkyong.io; public class App{ public static void main (String […]

Read more How to clear / delete the content of StringBuffer()