Mistake in 22. Substrings


In 22. Substrings it says

More examples:

  1. First 3 letters of "Batman"

Shouldn't it be .substring(0,2) to see the first 3 letters?

No sorry everything is all right! I was wrong haha


that's because the substring method method works like this

str.substring(start_index, end_index -1);

the substring method will always end one index less that what you provided