Skip to content

Latest commit

 

History

History
14 lines (11 loc) · 299 Bytes

iterate_over_a_string.md

File metadata and controls

14 lines (11 loc) · 299 Bytes

Iterate over a String

As was shown with while loops, being able to count up and down lets you iterate over each character in a String.

~void main() {
String name = "Lavigne";

for (int index = 0; index < name.length(); index++) {
    System.out.println(name.charAt(index));
}
~}