title: Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
body: <pre><code> public static String s1 = "team A won the match historically to clinch series which made surprise around the world ";
   public static String s2 = "He did his part";
  
   t1=s1.length();
   t2=s2.length();
   t3=Math.abs(t1-t2); 
  
    for(i=0;i&lt;t3;i++)
    {
        Sub_string.add(s1.substring(i,t2++));
    }
  </code></pre>
  
  <p>How can I solve this?</p>