 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Remove a character from a Java StringBuffer object
In order to remove a character from a Java StringBuffer object, we use the deleteCharAt() method. The deleteCharAt() removes the character at the specified index. The length of resultant sequence of characters of the StringBuffer object is reduced by one.
Declaration − The java.lang.StringBuffer.deleteCharAt() method is declared as follows−
public StringBuffer deleteCharAt(int index)
Let us see a program to illustrate the use of the deleteCharAt()
Example
public class Example {    public static void main(String[] args) {       StringBuffer sb = new StringBuffer("Hello World");       sb.deleteCharAt(7);       System.out.println(sb);    } }  Output
Hello Wrld
Advertisements
 