java loop through string chars code example Example: java loop through string chars String str = "hello"; for (char c : str.toCharArray()) //process c