Java-字符串的删插增

public class Stringh {
public static void main(String[] args) {
StringBuffer sbf = new StringBuffer(“What do you want”);

    sbf = sbf.delete(0,2);
    System.out.println(sbf.toString());

    sbf = sbf.insert(1,"your live");
    System.out.println(sbf.toString());

    sbf = sbf.append("Do you want to do ");
    System.out.println(sbf.toString());

}

}

你可能感兴趣的:(Java-字符串的删插增)