title: Taking the first letters of a name in a list of strings
body: <p>I am working on an assignment which states: </p>
  
  <p>The do while loop should not be your first choice when writing an iterative solution. As a general rule, if you can solve the problem reasonably with a while loop then you should do that. With that being said, there is no reason why we can't practice it a little bit.</p>
  
  <p>Ask the user to input a list of their favorite names. We will consider only one word names for this exercise. The user should keep inputting until "x' is entered as the name. Use a do-while loop to get all of the names. When the loop exits, output a string that contains the first initial of each name comma separated.</p>
  
  <p>The problem im having with this is outputting the first letters of the name and also ending the do-while loop. here is the code I have so far:</p>
  
  <pre><code>public static void main(String[] args) {
  
      Scanner in = new Scanner(System.in);
      String name;
      String first = "";
  
      System.out.println("Please enter a list of name: ");
      name = in.nextLine();
  
      do {
  
             name.charAt(0);
             first = first += name.charAt(0);
             name = in.nextLine();
  
             if(first != "") {
                  first = first + ",";
             }            
      } while(name != "x");
  
         System.out.println("The first intial if each name is " + name);
     }
  }
  </code></pre>