title: String substring index could be the length of string
body: <p>This is a Java string problem. I use the <code>substring(beginindex)</code> to obtain a substring.
  Considering <code>String s="hello"</code>, the length of this string is 5. However when I use <code>s.substring(5)</code> or <code>s.substring(5,5)</code> the compiler <strong>didn't give me an error.</strong> The index of the string should be from 0 to length-1.
  Why it doesn't apply to my case? I think that <code>s.substring(5)</code> should give me an error but it doesn't.</p>