Functions of the StringBuffer class

Source: Internet
Author: User

StringBuffer class

1. Add function

Public StringBuffer append (String str): Can add any type of data to the buffer and return to the buffer area

Public stringbuffer Insert (int offest,string str): Any type of data can be added to the buffer at the specified location and returned to the buffer area

2. Delete function

Public stringbuffer deletecharat (int index): Deletes the character at the specified position and returns itself

Public StringBuffer Delete (int start,int end): Deletes the character from the specified position to the end of the specified position, and returns itself Note: Contains start, does not contain end

3. Replacement function

Public StringBuffer replare (int start,int end,string str): From start to end, replace with STR

4. Reverse function

Public StringBuffer Reverse ()

Functions of the StringBuffer class

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.