This week's book giveaway is in the Other Open Source APIs forum. We're giving away four copies of Storm Applied and have Sean Allen, Peter Pathirana & Matthew Jankowski on-line! See this thread for details.
The ending number is zero-based, but you have to specify the index one past the last character that you want to be included. So the starting index is inclusive, and the ending index is exclusive. As Campbell says, it's probably that way because of conventions in other programming languages.
Agreed. The concept of inclusive start and exclusive end, is used in practically every other system that has substring -- and is intuitive to anyone that has ever used substring in any programming language.
On the other hand, I guess it can get confusing to someone who is just learning his/her first language.