Java Data Type Tutorial - Java StringBuilder .append ( CharSequence s, int start, int end)








Syntax

StringBuilder.append(CharSequence s, int start, int end) has the following syntax.

public StringBuilder append(CharSequence s,   int start,   int end)

Example

In the following code shows how to use StringBuilder.append(CharSequence s, int start, int end) method.

//  w w w  . j av  a 2 s.  c o  m
public class Main {

  public static void main(String[] arg) {

    StringBuilder buffer = new StringBuilder();
    CharSequence cs = "java2s.com";
    buffer.append(cs,1,2);
    System.out.println(buffer);
  }

}

The code above generates the following result.