char ch; int pos = 0; while (pos < s.length()) { ch = s.charAt(pos); pos++; }