Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
It wants the first character removed as well, if you set it to 0 it will also grab that character.
Just curious why is it 1 instead for 0? Isn't the first letter placed at 0?
Great!
This is because substr prints the number of characters after the
starting index
. Had you started from0
, you would just need to subtract1
to exclude thelast element
.But since you have started from
1
, it has shifted the range by1
, which means the last character is included again. So you need to subtract2
.According to documentation, the last index is the index of the first character to exclude, rather than the last one to include
Have you gotten an answer yet?
This make sense. You are getting the strings you want directly.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I also did -2 instead of -1 and it worked lol
I rank best practice so it gets noticed and hopefully fixed.. in this case I don't think that's going to happen!
First time I'm voting Best Practice for a cheat. Well, there's a first time for everything I guess.
We're almost a year later now ..
This comment is hidden because it contains spoiler information about the solution
because there are no random tests.
How is it possible?