title: Reading from a text file and ignoring spaces
body: <p>I am reading from a text file that looks like this:</p>
  
  <pre><code>A B C D
  E F G H
  I J K L
  M N O P
  </code></pre>
  
  <p>I will be storing this into a 4x4 char array. My problem is that whenever I am reading from the file it counts the space in between the letters causing it to store the space in the char array. How can i read the line without the spaces? Here is what i have got:</p>
  
  <pre><code>char[][] letters = new char[4][4]
  Scanner read = new Scanner(new File("letters.txt"));
  while(read.hasNextLine()) {
      for(int row = 0; row &lt; letters.length; row++) {
          String line = read.nextLine();
          for(int col = 0; col &lt; letters[row].length; col++) {
              letters[row][col] = line.charAt(col);
          }
      }
  }
  </code></pre>