C# C# Basics Strings Escape Sequences

Redon Kalemaj
Redon Kalemaj
1,227 Points

Can someone please figure this out because I am lost.

Program.cs
using System;

class Program
{

    static string Quote(string bitch)
        Console.WriteLine($(" {bitch} "));
    return Console.ReadLine();

    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

First, you're missing some { }'s for your Quote method.

Also, to use double quotes ("), you need to use an escape character within the string. Like this, for example:

Console.WriteLine("\"This is a quote inside double quote marks.\"");

That will print out "This is a quote inside double quote marks."

The \ character is used because otherwise, you're just ending the string, as all strings must be inside two double quotes.