????b??deleteCharAt????
????public StringBuffer deleteCharAt(int index)
?????÷?????????????????λ????????????????????γ??μ???????????磺
????StringBuffer sb = new StringBuffer(“Test”);
????sb. deleteCharAt(1);
??????????????????????????sb????????1??????????????????????????????????????μ???????????????sb??????”Tst”??
??????????????????????delete??????
????public StringBuffer delete(int start??int end)
?????÷???????????????????????????????????????start????????end??????????????磺
????StringBuffer sb = new StringBuffer(“TestString”);
????sb. delete (1??4);
????????????????????????1(????)???????4(??????)?????????????????????γ??μ?????????????sb?????”TString”??
????c??insert????
????public StringBuffer insert(int offset?? boolean b)
?????÷?????????????StringBuffer?????в????????????γ??μ???????????磺
????StringBuffer sb = new StringBuffer(“TestString”);
????sb.insert(4??false);
?????????????????????????sb???????4??λ?ò???false????γ??μ???????????????????sb?????”TestfalseString”??
????d??reverse????
????public StringBuffer reverse()
?????÷????????????StringBuffer?????е?????????????γ??μ???????????磺
????StringBuffer sb = new StringBuffer(“abc”);
????sb.reverse();
??????????????????sb?е?????????”cba”??
????e??setCharAt????
????public void setCharAt(int index?? char ch)
?????÷?????????????????????????indexλ????????μ????ch?????磺
????StringBuffer sb = new StringBuffer(“abc”);
????sb.setCharAt(1??’D’);
?????????sb????????”aDc”??
????f??trimToSize????
????public void trimToSize()
?????÷????????????StringBuffer??????д洢?????С?????????????????????????????????
????????????????????String??StringBuffer???????????????????????????????????????????????á?