Example usage for java.io StringWriter append

List of usage examples for java.io StringWriter append

Introduction

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

Prototype

public StringWriter 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) {

    StringWriter sw = new StringWriter();

    CharSequence sq = "tutorial from java2s.com";

    // append sequence
    sw.append(sq, 0, 5);

    System.out.println(sw.toString());

    // append second sequence
    sw.append(sq, 6, 5);//from  w  ww. j  a va 2 s  .c om

    System.out.println(sw.toString());

}