1 2 3 4 5 6 7 8 9 10 11 12
| StringBuffer str = new StringBuffer("Today is a good day!"); str.insert(11," very "); System.out.println(str); StringBuffer str1 = new StringBuffer("Today is a good day!"); StringBuffer str2 = new StringBuffer("Today is a good day!"); StringBuffer str3 = new StringBuffer("Today is a good day!"); System.out.println(str1.delete(0, 5)); System.out.println(str2.delete(0, 5)); System.out.println(str3.replace(0,5,"Tomorrow "));
|