for each letter on a string java code example
Example 1: iterate over string java
String str = "hello";
for (char c : str.toCharArray())
//process c
Example 2: java foreach char
for (char ch: "xyz".toCharArray()) {
System.out.println(ch);
}