title: How to disregard numbers when reading from a text file?
body: <p>Right now I want to store a text file that goes like this: </p>
  
  <p>1 apple</p>
  
  <p>2 banana</p>
  
  <p>3 orange</p>
  
  <p>4 lynx</p>
  
  <p>5 cappuccino</p>
  
  <p>and so on into a data structure. Would the best way of doing this be mapping the int to the string somehow, or should I make an arraylist? I'm supposed to, when I store the words themselves, disregard the int and any whitespace, and keep only the word itself. How do I disregard the int when reading in lines? Here is my hacked together code right now: </p>
  
  <pre><code>  public Dictionary(String filename) throws IOException {
    if (filename==null)
        throw new IllegalArgumentException("Null filename");
    else{
        try {
              BufferedReader in = new BufferedReader(new FileReader(filename));
              String str;
              int numLines=0;
              while ((str = in.readLine()) != null) {
                  numLines++;
              }
              String[] words=new String[numLines];
              for (int i=0; i&lt;words.length;i++){
                  words[i]=in.readLine();
              }
  
              in.close();
          } catch (IOException e) {
      }
    }
  </code></pre>
  
  <p>}</p>
  
  <p>Thank you in advance for the help!!</p>