Substrings: Why ...(3,7), instead of (3,6)?


So, if we are using zero-indexing, then if we want to get a substring beginning with the 4th letter through and including the 7th letter (in "wonderful day"), why isn't it "wonderful day".substring(3,6)??

That makes more sense since the 3rd position represents the 4th letter, so the 6th position - I would have 'thunk' - would represent the 7th. It seems inconsistent to me.


Maybe the defintion
will bring some comfort.