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








Syntax

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

public StringBuilder deleteCharAt(int index)

Example

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

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


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

The code above generates the following result.