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);
}
}





 

posted @ 2022-03-19 22:42  刘品水  阅读(105)  评论(0编辑  收藏  举报