title: Write a program that allows the user to enter a string and then prints the letters of the String separated by comma
body: <p>The output is always a String, for example <code>H,E,L,L,O,</code>. How could I limit the commas? I want the commas only between letters, for example <code>H,E,L,L,O</code>.</p>
  
  <pre><code>import java.util.Scanner;
  
  import java.lang.String;
  
  public class forLoop 
  
  {
      public static void main(String[] args)
      {
          Scanner Scan = new Scanner(System.in);
  
          System.out.print("Enter a string: ");
          String Str1 = Scan.next();
  
         String newString="";
         String Str2 ="";
          for (int i=0; i &lt; Str1.length(); i++)
          {
                  newString = Str1.charAt(i) + ",";
  
                  Str2 = Str2 + newString;  
  
          }
         System.out.print(Str2);
  
      }
  }
  </code></pre>