how to acces every char of a string in java

Solutions on MaxInterview for how to acces every char of a string in java by the best coders in the world

showing results for - "how to acces every char of a string in java"
Daniela
14 Jan 2019
1class Main
2{
3    // Iterate over the characters of a string
4    public static void main(String[] args)
5    {
6        String s = "Techie Delight";
7 
8        // using simple for-loop
9        for (int i = 0; i < s.length(); i++) {
10            System.out.print(s.charAt(i));
11        }
12    }
13}