Java examples for Language Basics:StringBuffer
Replace value in StringBuffer
public class Main { public static void main(String[] args) { StringBuffer sb = new StringBuffer("Hello World"); System.out.println("Original Text : " + sb); sb.replace(0,5,"Hi"); System.out.println("Replaced Text : " + sb); }//from w w w. ja v a2 s. c o m }