StringCharacterIterator setIndex Example
StringCharacterIterator class setIndex example. This example shows you how to use setIndex method.
StringCharacterIterator class setIndex example. char setIndex(int position) Sets the position to the specified position in the text and returns that character.
Here is the code
/*
* @ # SetIndex.java
* A class representing use to setIndex method of
* StringCharacterIterator class in java.text package
* version 13 June 2008
* author Rose India
*/
import java.text.*;
public class SetIndex {
public static void main(String args[]) {
StringCharacterIterator s =
new StringCharacterIterator("RoseIndia");
for(int i=s.getBeginIndex();i<s.getEndIndex();i++)
System.out.print(s.setIndex(i));
}
} |
|