StringCharacterIterator getBeginIndex Example
StringCharacterIterator class getBeginIndex example. This example shows you how to use getBeginIndex method.
StringCharacterIterator class getBeginIndex example. int getBeginIndex() Returns the start index of the text.
Here is the code
/*
* @ # GetBeginIndex.java
* A class representing use to clone getBeginIndex of
* StringCharacterIterator class in java.text package
* version 13 June 2008
* author Rose India
*/
import java.text.*;
public class GetBeginIndex {
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 |
|