title: Trying to Convert a string to another string from array in a file on only the first space
body: <p>Disclaimer, I've been at java for about a month.  I'm completely lost on this.  I'm trying to have a user input a phrase and if any strings in that phrase is found on the array, it returns the corresponding string in one line.  if the string isn't found, it would just skip it.  </p>
  
  <p>so if someone typed in "dog eat my fish"</p>
  
  <p>and the array holds:
  dog perro
  eat munched
  fish yellow trout</p>
  
  <p>it would return:
  perro munched yellow trout</p>
  
  <p>I haven't written the code to print out what I've got yet, but I know this code isn't working. </p>
  
  <p>any help would be greatly appreciated.  </p>
  
  <pre><code>import java.io.*;
  import java.util.*;
  
  public class ArrayTest2 {
      public static void main(String[] args)
      throws java.io.IOException {
          Scanner input = new Scanner(System.in);
  
          String userString = " ";
          userString = englishString();       
  
          String[][] wordList = new String[10][2];
          loadEnglishString(wordList);
  
      }
      public static String englishString() {
          Scanner input = new Scanner(System.in); 
          String s1 = " ";
          System.out.println("Please enter a phrase to translate: ");
          s1 = input.nextLine().trim().toUpperCase();
  
          return s1;
      }
  
  
  
      public static void loadEnglishString(String[][] wordList)  
          throws java.io.IOException {
          String filName = " ";       
          filName = ("/home/chrism/ArrayTest2.txt");
          Scanner input = new Scanner(new File(filName));  
          while(input.hasNextLine()) {
              String line = input.nextLine();
              StringTokenizer st = new StringTokenizer(line);
              while (st.hasMoreTokens()) {
                  boolean stop = false;
                  for(int i = 0; i &lt; wordList.length; i++) {
                      if(stop)
                          break;
                      for(int j = 0; j &lt; wordList[i].length; j++) 
                          if(input.hasNextLine())
                              wordList[i][j] = input.nextLine();
                          else {
                              stop = true;
                          }
                          break;
                  }
              }
          }
  
          input.close();
      }
  
  
  }
  </code></pre>