title: Dealing with FileReader and subString
body: <p>I'm trying to read a file <code>.txt</code> which contains 8 lines of Stores in different regions. Each line has 15 characters. When I run this code, just the first line is printed and afterwards it throws this:</p>
  
  <pre class="lang-none prettyprint-override"><code>Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 10
      at java.lang.String.substring(String.java:1951)
  </code></pre>
  
  <pre class="lang-java prettyprint-override"><code>String line = "";
  String region = "", name = "";
  BufferedReader file = new BufferedReader(new FileReader("Stores.txt"));
  line = file.readLine();
  while (line != null) {
      region = line.substring(0, 10);
      name = line.substring(10);
      line = file.readLine();
      System.out.println("" + region + name);
  }
  file.close();
  </code></pre>
  
  <p>File:</p>
  
  <pre class="lang-none prettyprint-override"><code>Montrèal   16890
  
  New York   27659
  
  Pittsburg  26657
  
  California 11201
  
  Virginia   32945
  
  Seattle    33981
  
  Colorado   10345
  </code></pre>