Substrings help ..

Status
Not open for further replies.

goofymcdooperface

Reputable
Feb 19, 2014
64
0
4,640
so today in CS class we where told by our teacher to go on the website known as codeacademy.com and do our home work on there and our home work was to get up to lesson 22 on java in lesson 22 they ask us to create a substring and i did that but for some reason it tells me that there is something wrong with my syntax
here's the code.

"wonderful day". substring(4,5,6,7);
4===d 5===e 6===r 7===f
 
Solution
subtring takes only 2 arguments. Beginning index and end index to extract a part of the string.

subtstring(4, 7) should get you what you're looking for if your trying to get 'derf'.
Status
Not open for further replies.