Example usage for java.io PrintWriter append

List of usage examples for java.io PrintWriter append

Introduction

In this page you can find the example usage for java.io PrintWriter append.

Prototype

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

Source Link

Document

Appends a subsequence of the specified character sequence to this writer.

Usage

From source file:Main.java

public static void main(String[] args) {
    CharSequence sq1 = "Hello";
    CharSequence sq2 = " World";

    PrintWriter pw = new PrintWriter(System.out);

    // append the sequence
    pw.append(sq1, 1, 3);
    pw.append(sq2, 1, 4);//from   w  ww.  j  ava2 s  . co m

    // flush the writer
    pw.flush();

}