How to iterate through a String

Viewed 117348

How can I iterate through a string in Java?

I'm trying to use a foreach style for loop

for (char x : examplestring) {
    //action
}
4 Answers
Related