Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Because at that point index
i+1
is same as string length.And exception is not thrown by substring unless index is greater than string length
Refer: https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#substring(int)
Can someone explain how when the i gets to the last letter (str.length -1) there is not an out of bounds exception caused by the str.substring(i+1) ?