CharacterIterator: first() : CharacterIterator « java.text « Java by API






CharacterIterator: first()

 

import java.text.CharacterIterator;
import java.text.StringCharacterIterator;

public class Main {
  public static void main(String[] argv) throws Exception {
    CharacterIterator it = new StringCharacterIterator("abcd");

    char ch = it.first(); 
    ch = it.current(); 
    ch = it.next(); 
    ch = it.current(); 
    ch = it.last(); 
    int pos = it.getIndex(); 
    ch = it.next(); 
    pos = it.getIndex(); 
    ch = it.previous(); 
    ch = it.setIndex(1);
  }
}

   
  








Related examples in the same category

1.CharacterIterator.DONE
2.CharacterIterator: current()
3.CharacterIterator: getIndex()
4.CharacterIterator: last()
5.CharacterIterator: previous()
6.CharacterIterator: setIndex(int position)