Java Data Type Tutorial - Java StringBuffer.deleteCharAt(int index)








Syntax

StringBuffer.deleteCharAt(int index) has the following syntax.

public StringBuffer deleteCharAt(int index)

Example

In the following code shows how to use StringBuffer.deleteCharAt(int index) method.

 
public class Main {
  public static void main(String args[]) {
    StringBuffer sb = new StringBuffer("java2s.com.");


    sb.deleteCharAt(0);
    System.out.println("After deleteCharAt: " + sb);
  }
}

The code above generates the following result.