title: Switchstatement stops reading at white spaces
body: <p>So I'm having a problem doing an assignment for my java class. The purpose is to create a program that uses a switch statement to convert letters from a string to their phonetics. i.e, A or a becomes Alpha.</p>
  
  <p>The problem I'm having is the switch statement stops reading at the first whitespace in the string. How do i get it to continue reading the string without stopping at whitespaces
  (i.e " ")?</p>
  
  <p>Basically user inputs a string "Hi Hi" the output should be "Hotel Indiana Hotel Indiana"</p>
  
  <p>The problem I'm having is it only gives "Hotel Indiana" stopping at the first whitespace i think at least.</p>
  
  <p>This is the code i have so far:(I cut out most of the letters/numbers to save space and kept what i thought was most important for answering the question.)</p>
  
  <pre><code>    import java.util.*;
      public class SwitchStatement {
  
  /**
   * @param args
   */
  public static void main(String[] args) {
  
      Scanner keyboard = new Scanner(System.in);
      System.out.println ("Enter a message: ");
      String message = keyboard.next(); 
      for(int i = 0 ; i &lt; message.length(); i++) 
        switch(message.charAt(i)) { 
      case 'a':
      case 'A':  
          System.out.print("Alpha"); 
          break; 
      case 'b':
      case 'B':  
          System.out.print("Bravo"); 
          break;
      case ' ':  
                  System.out.print(" "); 
                  break;
      default:  
                  System.out.print(message.charAt(i)); 
                  break;
  }
  
  }
  }
  </code></pre>
  
  <p>Thanks in advance for the help.</p>