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

C# C# Basics (Retired) Console I/O Formatting Output

Andrew Kotze
Andrew Kotze
994 Points

Console.WriteLine(firstName + “ rocks!”); I am sure this is right but I continue to get a 'wrong' answer

Console.WriteLine(firstName + “ rocks!”); I am sure this is right but I continue to get a 'wrong' answer

CodeChallenge.cs
string firstName = Console.ReadLine();
Console.WriteLine(firstName +  rocks!);

1 Answer

Steven Parker
Steven Parker
229,788 Points

:point_right: You have the wrong kind of quotes around your string.

The difference is subtle, but if you look closely, you can see that your quotes have different appearances for the left and right side. The standard quotes for programming are the same on both sides.

Did you actually type in this answer, or did you copy it and paste it in? I actually promote copy/paste for challenge string content, but don't copy the quotes!

Console.WriteLine(firstName +  rocks!);  // word-processing quotes (bad)
Console.WriteLine(firstName + " rocks!");  // standard/programming quotes (good)

Note that the syntax coloring will make your literal strings a different color when the quotes are right.