Hi Folks, I kindly need your help here, I am aware the first letter starts at position 1 etc. I am on exercise 22 substrings


#1

<Below this line, in what way does your code behave incorrectly? Include ALL error
messages.>
This the error message I get: Oops, try again. Did you remember to take your .substring() from the string 'wonderful day'? Make sure to type your string exactly as shown!


"Wondeful day". substring(3,6);


#2

The exercise wants you to get the 4th-7th letters, right? Which would equal "derf"


i think you're using the little trick for counting starting at zero, subtracting 1 from the "real" number. That works for individual letters, but to get a whole substring you can't do that.

The first number can use the "trick", but the last number/letter can use it's normal number.


So you can change the 6 to a 7, and you also misspelled "wonderful"


#3

yeah at one point I changed the substring to (3,7) and still got an error, so I managed to pick up where the main error was coming from, was the misspelled word wonderful. Thanks a million @robotica, bye!


#4

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