C# C# Basics Strings Escape Sequences

michael edmondson
michael edmondson
3,369 Points

Hey it feels like im close but where am i going wrong with my method?

Hey im adding the forward slash before the \" where am i going wrong with this?

Program.cs
using System;

class Program
{

    // YOUR CODE HERE: Define a Quote method!


    static string Quote(string Question)
    {
        return (\"Question\"");
    }
    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

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 51,836 Points

Since the challenge was about escape sequences I'm not sure if there is a better answer. I was just focused on the syntax coloring so that the parameter Question was returned instead of the string "Question". This passed:

 static string Quote(string Question)
    {
        return ("\"" + Question + "\"");
    }