title: Should I use charAt or toCharArray?
body: <p>Which of the following options is considered a good practice to loop through the <code>String</code>?<br>
  Should we use <code>charAt</code> or convert to a char array ? I am looking for answers in all terms including performance and space used </p>
  
  <pre><code>public static void doChose (String str) {
  
          for (int i = 0; i &lt; str.length(); i++) {
              System.out.println(str.charAt(i));
          }
  
          // vs
  
         char[] chars = str.toCharArray();
         for (char c : chars) {
             System.out.println(c);
         }
  
      }
  </code></pre>