You could do something like this:



String s = "abcde";
CharacterIterator it = new StringCharacterIterator(s);

while(it.current() != CharacterIterator.DONE) {
char current =...