C# C# Basics Strings Escape Sequences

Alex Smutny
Alex Smutny
392 Points

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
201,355 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.