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 trialDaniel Hildreth
16,170 PointsQuiz Question 3 Deserialize The News Results
Ok, I feel very stupid, but I do not know what this question is asking. I have tried using indexes ( {0} ), and I have even tried using Object.apples with these blanks. I've looked at the string.Format documentation and it seems I have to know what object I'm calling in order to use this method; hence why I tried using object.apples in it. Can someone please tell me what I'm doing wrong, and why it's wrong?
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")
3 Answers
Simon Owerien
12,829 PointsI tried it myself and indexes are working, maybe you made a typo
Terry McDuffie
12,786 Pointsstring.Format("The current date is ", DateTime.Now.Date)
string.Format("The current date and time is ", DateTime.Now)
Daniel Hildreth
16,170 PointsThe next two questions are just asking for indexes. So the first one asks the index for the current date, so you write that as {0}. The next question asks for the same thing you're just adding in the current time to the date. If you rewatch the video, you'll find this answer about half way through or towards the end of the video. They simply put in a :F.
Terry McDuffie
12,786 Points{0} {1} {2}
I can't pass the other two
Daniel Hildreth
16,170 PointsTerry McDuffie What other two can you not pass?
Daniel Hildreth
16,170 PointsDaniel Hildreth
16,170 PointsYes they work. I stupidly was starting the index at 1 instead of 0.