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

Ruby Ruby Basics (Retired) Ruby Strings What are Strings?

Mark Bradshaw
PLUS
Mark Bradshaw
Courses Plus Student 7,658 Points

Not sure how this question should be answered. Please advise

I understand how to create strings in ruby, but the way this question is being asked is a little confusing. Below is the question:

Fill in the blank below. Fill in the blank characters to create a valid Ruby string.

website = ________Treehouse________

so my string would look like this: string = <<-STRING Hello World! STRING

I can't get my string to work in the questions' layout.

5 Answers

Mark Bradshaw
PLUS
Mark Bradshaw
Courses Plus Student 7,658 Points

This is very helpful, but is the second blank where I add the hello.rb?

Stone Preston
Stone Preston
42,016 Points

all you need to add in the blanks are the quotes. nothing else.

Stone Preston
Stone Preston
42,016 Points

Ruby strings are enclosed in quotes like so

"Treehouse"

so you would need to put 1 quotation mark in each blank

website = "Treehouse"

note that you can use either single or double quotes ie

"Treehouse"

or

'Treehouse'

but you can only use interpolation on strings enclosed in double quotes. so most of the time I just use double quotes

Mark Bradshaw
Mark Bradshaw
Courses Plus Student 7,658 Points

This is very heloful, but after the treehouse blank do I add hello.rb?

Mark Bradshaw
Mark Bradshaw
Courses Plus Student 7,658 Points

Finally figured it out. I missed the simplicity of the question. Thanks.

Martina Carrington
Martina Carrington
15,754 Points

Thanks Stone, this is very helpful .

Hi Mark,

I think you are trying the multi-line syntax (Heredoc) for a single line string and that's the problem. To make ________Treehouse________ a string in Ruby, you just need to put a single or a double quote character in those blanks and that's it.

Mark Bradshaw
Mark Bradshaw
Courses Plus Student 7,658 Points

I finally figured it out. Thanks for the assistance.

Wow, this was an unnecessarily confusing question.

Mark Bradshaw
Mark Bradshaw
Courses Plus Student 7,658 Points

I eventually figure it out, but l felt the same way.

headline = "Website:_______Treehouse" What about this one?