C# C# Basics Strings Combining Strings

Concatenation

Everything I put in my methods body keeps returning an error.

Program.cs
using System;

class Program
{

    // YOUR CODE HERE: Define an Eat method!
    static string Eat(string firstString, string secondString)
    {

        return;
    }

    static void Main(string[] args)
    {
        string firstString = "I think";
        string secondString = "are tasty";

        Console.WriteLine(Eat($"{firstString} apples and blueberries {secondString}"));
        Console.WriteLine(Eat($"{firstString} carrots and daikon {secondString}"));
    }

}

1 Answer

Steven Parker
Steven Parker
177,843 Points

Part of the issue is that you should put your code only in your method. Don't make any changes to the "Main" method!

Then, be sure to return the string you build in the method using the arguments that are passed in.

Thank you!

Sebastian Manczak
Sebastian Manczak
3,551 Points

Any chance you could please post the final correct answer to the task?

Steven Parker
Steven Parker
177,843 Points

Treehouse discourages posting of explicit answers, but that would generally not be the best thing to help you learn anyway.

If you're having trouble, start a new question where you can post your code and get some hints to help you solve it yourself.