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 String Creation

Jimmy Cheung
Jimmy Cheung
7,831 Points

One of the question tells me the given code would create a valid string in Ruby with 3 lines in it but it generates 4.

One of the question asks:

The following code would create a valid string in Ruby with 3 lines in it:
string = "
My Ruby string here
Is created in three lines
This is a haiku"

I answer "False" and it was incorrect but the console told me otherwise.

1 Answer

Jack McDowell
Jack McDowell
37,797 Points

You're technically right, if it were

string = "My Ruby string here
Is created in three lines
This is a haiku"

it would be 3 lines, but I imagine that they weren't counting the whitespace.