Java IO Tutorial - Java CharArrayWriter .append ( CharSequence csq, int start, int end)








Syntax

CharArrayWriter.append(CharSequence csq, int start, int end) has the following syntax.

public CharArrayWriter append(CharSequence csq,   int start,   int end)

Example

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

//w  w w. j av a2  s .  com
import java.io.CharArrayWriter;

public class Main {
  public static void main(String[] args) {


    CharArrayWriter chw = new CharArrayWriter();

    // declare character sequence
    CharSequence csq = "tutorial from java2s.com";

    // append character sequence to the writer
    chw.append(csq, 2, 5);

    // prints out the character sequences
    System.out.println(chw.toString());

  }
}

The code above generates the following result.