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# Streams and Data Processing Streaming Data on the Net Deserialize the News Results

Cathal Kenneally
Cathal Kenneally
5,734 Points

Please Help Can't pass this quiz

Complete the following code in order to produce a string that prints the "I like apples and oranges, but I don't like bananas."

string.Format("I like {} and , but I don't like .", "apples", "oranges", "bananas")

I have tried using {0} {1} {2} but to no avail. What am I doing wrong?

2 Answers

Subhadeep Ray
Subhadeep Ray
12,933 Points

I'm not sure about the exact line of code you used.

Anyway, the correct answer should be: var message = string.Format("I like {0} and {1}, but I don't like {2}.", "apples", "oranges", "bananas");

Steven Parker
Steven Parker
231,275 Points

It sounds like you have the correct answer, but you didn't show the line with the blanks filled in that way.

Try again, and if you still have trouble, be sure to copy the line with your answers filled in and paste it here.