📜  替换索引处的子字符串 java 代码示例

📅  最后修改于: 2022-03-11 14:52:14.308000             🧑  作者: Mango

代码示例1
public static void main(String[] args) {

        StringBuffer buf = new StringBuffer("123456789");

        int start = 3;
        int end = 6;
        buf.replace(start, end, "foobar"); 
        System.out.println(buf);

    }

}