StringBuffer中delete(x, y) 删除左闭右开区间的元素,append() 函数用于连接字符串。
package com.czie.iot1913.lps.genericityDemo.Demo03;
/**
* @author 1944900433@qq.com
* @date 2022-03-19 21:50
*/
public class Test {
public static void main(String[] args) {
StringBuffer a = new StringBuffer("JavaYYDS");
StringBuffer b = new StringBuffer("Google");
a.delete(1, 3);
a.append(b);
System.out.println(a);
}
}