StringCharacterIterator getEndIndex Example
StringCharacterIterator class getEndIndex example. This example shows you how to use getEndIndex method.
StringCharacterIterator class getEndIndex example. int getEndIndex() Returns the end index of the text. This index is the index of the first character following the end of the text.
Here is the code
/*
* @ # GetEndIndex.java
* A class representing use to getEndIndex method of
* StringCharacterIterator class in java.text package
* version 13 June 2008
* author Rose India
*/
import java.text.*;
public class GetEndIndex {
public static void main(String args[]) {
StringCharacterIterator s =
new StringCharacterIterator("Roseindia");
System.out.println("Begin index of the iterator " +
s.getBeginIndex());
System.out.println("End index of the iterator " +
s.getEndIndex());
}
} |
Output
Begin index of the iterator 0
End index of the iterator 9 |
|