Back to Freecodecamp

Perform Basic String Formatting in C#

curriculum/challenges/english/blocks/write-your-first-code-using-c-sharp/647e23828acb466c97ccbf03.md

latest1.2 KB
Original Source

--description--

This challenge will be partially completed on the Microsoft Learn platform. Follow these instructions to complete the challenge:

  1. Go to <a href="https://learn.microsoft.com/training/modules/csharp-basic-formatting/" target="_blank" rel="noreferrer">https://learn.microsoft.com/training/modules/csharp-basic-formatting/</a> and complete all the tasks for the "Perform Basic String Formatting in C#" module. This is required to earn the "Write Your First Code Using C#" trophy on Microsoft Learn, and qualify for the certification exam.
  2. When you are finished, come back and correctly answer the question below.

--assignment--

Complete the <a href="https://learn.microsoft.com/training/modules/csharp-basic-formatting/" target="_blank" rel="noreferrer">Perform Basic String Formatting in C#</a> module on Microsoft Learn. Then, answer the question below.

--questions--

--text--

Which of the following lines of code correctly uses string interpolation assuming that the variable value is a string?

--answers--

Console.WriteLine(@"My value: {value}");


Console.WriteLine($"My value: {value}");


Console.WriteLine(@"My value: [value]");

--video-solution--

2