StringCharacterIterator class current example. This example shows you how to use current method.
StringCharacterIterator class current example. This example shows you how to use current method.
StringCharacterIterator class current example. char current() Gets the character at the current position (as returned by getIndex()).
Here is the code
/*
* @ # Current.java
* A class repersenting use to current method of
* StringCharacterIterator class in java.text package
* version 13 June 2008
* author Rose India
*/
import java.text.*;
public class Current {
public static void main(String args[]) {
StringCharacterIterator s = new StringCharacterIterator("Roseindia");
for (char ch = s.first(); ch != CharacterIterator.DONE;
ch = s.next()) {
//Display current char
System.out.print(s.current());
}
}
} |
|