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

Tojo Alex
PLUS
Tojo Alex
Courses Plus Student 13,331 Points

Desperate help needed

Please could you tell me what is the answer for question 2 and 3. My head is completely aching from continuously watching the video.

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

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

11 Answers

Steven Parker
Steven Parker
231,269 Points

Replacement tokens in a "format" string are braces with the argument index number (starting at 0) inside them.

Both of the questions you asked about originally can be solved by adding normal tokens in the blank(s). For the one with multiple blanks, each token will have a different number in it.

The other date question requires a special formatting specifier. For that, you can use one of the standard date/time format strings described in the documentation page I just linked.

Here's an excerpt from that documentation page:

"f" Full date/time pattern (short time). :point_right: Monday, June 15, 2009 1:45 PM
"F" Full date/time pattern (long time). :point_right: Monday, June 15, 2009 1:45:30 PM
"g" General date/time pattern (short time). :point_right: 6/15/2009 1:45 PM
"G" General date/time pattern (long time). :point_right: 6/15/2009 1:45:30 PM

You want the single-letter format specifier that matches the description in the instructions.

I'll bet you can get it now. :wink:

Tojo Alex
PLUS
Tojo Alex
Courses Plus Student 13,331 Points

Sorry about that . Also in my question I said that I had a problem with this : string.Format("I like and , but I don't like .", "apples", "oranges", "bananas"). Well that was wrong,I have the answer to that question it is actually this one : string.Format("The current date is .", DateTime.Now.Date). Could you explain what to do here.

Steven Parker
Steven Parker
231,269 Points

I expanded my answer a bit more.

Tojo Alex
PLUS
Tojo Alex
Courses Plus Student 13,331 Points

I couldn't find anything that matched the instructions either that its not there or that I missed it (which probably is the reason why). I'm just really stressed because when I finish this I finish a whole track.

Tojo Alex
PLUS
Tojo Alex
Courses Plus Student 13,331 Points

I worked out the first one that I originally asked though the second one that I asked still confuses me.

Tojo Alex
PLUS
Tojo Alex
Courses Plus Student 13,331 Points

I worked out the answer thanks for assistance. The annoying thing though is that this test won't let you off 2 out of 3. The first question is what is getting on my nerves.(edited)

Steven Parker
Steven Parker
231,269 Points

I think passing a quiz requires 80%, so you can't get any wrong when the quiz has less than 5 questions.

This works for me.........

string.Format("I like {0}_ and {1}, but I don't like _{2}__.", "apples", "oranges", "bananas")