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 trial

CSS Advanced Sass Advanced Functions Strings

Kabolobari Benakole
PLUS
Kabolobari Benakole
Courses Plus Student 14,278 Points

What am I doing wrong

style.scss
$words: 'this is the first string';
$new-words: str-insert($words, 'not ', 2);

.block {
  content: $new-words;
}

1 Answer

Steven Parker
Steven Parker
231,248 Points

You'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
Kabolobari Benakole
Courses Plus Student 14,278 Points

Hi, 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

$words: 'this is the first string';
$new-words: str-insert($words, ' not ', 7);

.block {
  content: $new-words;
}

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
Steven Parker
231,248 Points

You'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);