title: error : String index out of range, Why?
body: <p>Search haebwado moreugeteoseo heck raises questions.</p>
  
  <p>my code</p>
  
  <pre><code>int nTimeIdxNum = -1;
  
                  try {
                      nTimeIdxNum = k.indexOf("x22T:");
                  }catch(Exception e) {
                      System.out.println(e.getMessage());
                  }
  
                  if (nTimeIdxNum &gt; -1) {
                      String local_date = "";
                      System.out.println("k.length() = " + k.length());
                      System.out.println("nTimeIdxNum = " + String.valueOf(nTimeIdxNum));
                      try {
                          local_date = k.substring(nTimeIdxNum, 13);
                      }catch(Exception e) {
                          System.out.println(e.getMessage());
                      }
  </code></pre>
  
  <p>}</p>
  
  <p>and Console result</p>
  
  <hr>
  
  <p>k.length() = 952
  nTimeIdxNum = 495
  String index out of range: -482</p>
  
  <hr>
  
  <p>Why if an error occurs long enough length..
  please help me</p>