C# C# Streams and Data Processing Streaming Data on the Net Deserialize the News Results

Daniel Hildreth
Daniel Hildreth
16,170 Points

Quiz 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
Simon Owerien
12,817 Points

I tried it myself and indexes are working, maybe you made a typo

Daniel Hildreth
Daniel Hildreth
16,170 Points

Yes they work. I stupidly was starting the index at 1 instead of 0.

{0} {1} {2}

I can't pass the other two

string.Format("The current date is ", DateTime.Now.Date)

string.Format("The current date and time is ", DateTime.Now)

Daniel Hildreth
Daniel Hildreth
16,170 Points

The 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.