Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJay Reyes
Python Web Development Techdegree Student 15,937 PointsSUBSTR doesn't start from 0?
I'm curious as to how many other programming languages: indices start at 0, but SQL function SUBSTR at 1.
1 Answer
Stuart Wright
41,120 PointsIt's very unusual. The only one I've ever used is R (although I am sure there are some others). Every other language I've used starts at 0 (Python, PHP, JavaScript, Java, C#, C++/C).
Edit to add link with table: https://en.wikipedia.org/wiki/Comparison_of_programming_languages_(array)#Array_system_cross-reference_list