Confusion with substrings


#1

Hi,

I'm doing the basics for substrings and the problem they want me to solve is to find the substring "Jan" in "January". From what I've learned so far the first letter starts with 0 and the second letter is 1 and so on. So back to this problem the letter "J" is 0 and the letter "A" is 1 and the letter "N" is 2. The answer for "JAN" should be (0,2), but the answer they're giving me is (0,3). i've been trying to figure this one out for a while. How is the answer not what I have?


#2

Look up how the function uses its arguments
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/substring


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.