Java StringBuffer.delete(int start, int end)

Syntax

StringBuffer.delete(int start, int end) has the following syntax.

public StringBuffer delete(int start,   int end)

Example

In the following code shows how to use StringBuffer.delete(int start, int end) method.


public class Main {
  public static void main(String[] argv) {
    StringBuffer sb = new StringBuffer();
    sb.append(true);/*from  w ww. j a va2 s .c om*/
    sb.append("java2s.com");
    
    sb.delete(1, 2);
    System.out.println(sb.toString());
  }
}

The output:





















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