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

i have the correct code, but still no result

I have the method correctly written and the escape sequence used for double quotes = \".

but result says otherwise

Program.cs
using System;

class Program
{

    // YOUR CODE HERE: Define a Quote method!

    static string Quote(string q1)
    { 
        return q1;
    }

    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.\" "));
    }

}

2 Answers

What does your result say? For your code I get 2 quotes listed out as follows.

"When you learn, teach. When you get, give."

"No gains without pains."

We called Quote("Patrick, I don't think wumbo is a real word."), but we got a return value of: 'Patrick, I don't think wumbo is a real word.'. We were expecting '"Patrick, I don't think wumbo is a real word."'.

This is what I get as a result

If you get that response then please post your actual code

I wrote similar code as Mohammed and got the same message about "wumbo". That message that he posted on May 1 also appears as the "Bummer" message.