title: Trying to find if there are at least 2 words in a string
body: <p>I am trying to find out if a phrase entered by the user has at least 2 words in it. If it does not, keep asking them to enter a phrase until they enter one with at least 2 words. </p>
  
  <p>Here is my code so far: It can successfully detect if they have entered 2 words, and it successfully detects if they don't enter 2 words the FIRST time, but if they enter below 2 words again the second time the program quit.</p>
  
  <pre><code>private static void stringfunctions() {
      String phrase;
      int count = 0;
      Scanner input = new Scanner(System.in);
  
      while (count &lt; 2) {
          System.out.println("Please enter a multiple word phrase: ");
          phrase = input.nextLine();
          String[] arrPhrase = phrase.split(" ");
          for (int i = 0; i &lt; arrPhrase.length; i++) {
              if (arrPhrase[i].equals(" ")) {
              } else {
                  count++;
              }
          }
  
      }
  </code></pre>