public class CharIterator extends Object
CharSequence.chars().| Constructor and Description |
|---|
CharIterator(String s) |
CharIterator(String s,
int startIndex) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext()
Determines if there are more characters to iterate over.
|
int |
index()
Gets the index of the current character in the string.
|
char |
next()
Advances to the next character.
|
char |
prev()
Gets the previous character.
|
public CharIterator(String s)
s - the string to iterate overpublic CharIterator(String s, int startIndex)
s - the string to iterate overstartIndex - the index to start atpublic boolean hasNext()
public char next()
public char prev()
public int index()
Copyright © 2012–2026 Michael Angstadt. All rights reserved.