Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialKabolobari Benakole
Courses Plus Student 14,278 PointsWhat am I doing wrong
$words: 'this is the first string';
$new-words: str-insert($words, 'not ', 2);
.block {
content: $new-words;
}
1 Answer
Steven Parker
231,248 PointsYou're really close! It looks like you're setting the index for "str-insert" to be the number of words to skip.
But it should be the number of characters to skip instead.
Kabolobari Benakole
Courses Plus Student 14,278 PointsKabolobari Benakole
Courses Plus Student 14,278 PointsHi, Stephen, thanks for your answer. But I still don't get it. I'm supposed to insert the new word "not" at index position 2, counting from 0 right of the
$words
string. And that's what I thought I've done by the syntax.I tried
and still got "Bummer: The 'content' attribute for the .block element is not correct. Did you call the str-insert function with the right arguments?"
Steven Parker
231,248 PointsSteven Parker
231,248 PointsYou're almost there!
You only need to add one new space with the word (as you had originally). And the position is off by one:
$new-words: str-insert($words, 'not ', 8);