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.");
//from w w w  . j a  v a  2 s  .  co m

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

The code above generates the following result.





















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable