Example usage for java.text StringCharacterIterator StringCharacterIterator

List of usage examples for java.text StringCharacterIterator StringCharacterIterator

Introduction

In this page you can find the example usage for java.text StringCharacterIterator StringCharacterIterator.

Prototype

public StringCharacterIterator(String text, int begin, int end, int pos) 

Source Link

Document

Constructs an iterator over the given range of the given string, with the index set at the specified position.

Usage

From source file:Main.java

public static void main(String[] args) {
    String text = "this is a test";
    CharacterIterator it = new StringCharacterIterator(text, 4, 27, 5);

    for (char ch = it.first(); ch != CharacterIterator.DONE; ch = it.next()) {
        System.out.print(ch);//from   ww w. j a v  a  2 s  .c  om
    }
}