public static void main(String[] args) {
     StringBuffer s = new StringBuffer("123456789");
     //s.delete(0,3).replace( 1,3, "24").delete(4,6);
         
     s.delete(0,3);              //456789   删除123
     System.out.println(s);
     s.replace( 1,3, "24");      //424789   替换56为24
     System.out.println(s);
     s.delete(4,6);              //4247     删除89
     System.out.println(s);
}

PS:不管那些花里胡哨的东西,将方法拆开实现,简单直接.

相关文章:

  • 2021-04-25
  • 2021-05-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-04
  • 2022-03-02
猜你喜欢
  • 2021-12-19
  • 2022-12-23
  • 2022-02-08
  • 2022-12-23
  • 2021-07-16
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案