Java StringBuffer Replace Example
public class Main { public static void main(String[] args) { StringBuffer sb = new StringBuffer("Hello World"); System.out.println(sb); sb.replace(0, 5, "Hi"); System.out.println(sb); } }