Check out example codes for "java for character c in string iterate cout i". It will help you in understanding the concepts better.

Code Example 1

String s = "...stuff...";

for (int i = 0; i < s.length(); i++){
    char c = s.charAt(i);        
    //Process char
}

Learn ReactJs, React Native from akashmittal.com