Quick question most likely very simple.
Basically, I need to change a string from obdurate to obliteration. I'm aware of the methods that I can use with StringBuilder but I'm unable to insert anything after the initial string. Is there anyway to add more characters?
my code is as follows
public class SimpleString {
public static void main (String [] args){
StringBuilder s1 = new StringBuilder ("obdurate");
s1.delete(2, 7);
s1.replace(2, 7, "lite");
s1.insert(8,15, "ration"); //the problem line.
System.out.println(s1);