
kal alben-mccave
2,714 PointsIs my code correct C# string interpolation
Hey community I would appreciate some help with this code, it's just not compiling
thank you
using System;
class Program
{
static string Eat(string foodOne, string foodTwo)
{
return $"{I think} foodOne {and} foodTwo {are tasty}!";
}
static void Main(string[] args)
{
Console.WriteLine(Eat("apples", "blueberries"));
Console.WriteLine(Eat("carrots", "daikon"));
}
}
2 Answers

KRIS NIKOLAISEN
Pro Student 51,822 PointsThe brackets go around foodOne and foodTwo since those are what is being replaced.

kal alben-mccave
2,714 PointsThanks appreciate it