Replace this line with your code.
In String Practice #23 I keep getting the error message "You have selected the wrong substring in January" although I have chosen the correct substring "//console.log "January" substring (0,2))
Please use the edit button to improve your question. The template will help you with that.
I have tried to edit the code referenced above many times but it will not work and I cannot skip over it and progress.
Don't worry about the code in the exercise just yet.
It will help people understand your question, if first, you edit your original question here in this forum.
Add a link to the exercise. Replace the line that says "Replace this line with your code" with the code that you have tried in the exercise.
Thanks I got it to work. However I am a little confused by the "0" position. For the word "January" the J is in the zero spot but a=1 and n=2 but it seems like n must =3. Please explain.
You are correct that:
0 : J
1 : a
2 : n
3 : u
substring works like this:
.substring(starting character, up to but not including the end character)
So why does it not accept
Could you give me a screen shot showing that code not being accepted please?
Here it is. I have tried retyping the January line, and different start and end position numbers, all with the same result. Am I missing seeing a mistake in what I entered?
Thanks for following up.
I like solving problems
The problem there is that you've missed a bit of the instructions. They have asked you to print out the substrings but you haven't yet.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.