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 Strings Escape Sequences

This question and the last test seem to be way off.... The answers don't even relate to what is in the code...

Not sure what I am doing wrong, but the code is outputting Patrick, I don't think wumbo.... etc...?????

Program.cs
using System;

class Program
{

    // YOUR CODE HERE: Define a Quote method!
    static string Quote(string one)
    {
        return one;   
    }

    static void Main(string[] args)
    {
        // Quote by Maya Angelou.
        Console.WriteLine(Quote("\"When you learn, teach. When you get, give.\""));
        // Quote by Benjamin Franklin.
        Console.WriteLine(Quote("\"No gains without pains.\""));
    }

}

1 Answer

Steven Parker
Steven Parker
229,744 Points

You're partway there, your method returns the string. But the instructions say that it should return it "surrounded by double quotes". So you still need to add quote characters to the start end end of the string.

The challenge tester calls the method directly with a test string, which as you noticed is different from those shown in the sample "Main" routine. But once the new code works correctly it will pass the challenge.