How should you complete the code?

Drag Drop
You need to write code that will display value 1, and then value2 in the console.
You write the following code:

How should you complete the code? To answer, drag the appropriate code elements to the correct targets. Each code element may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.
Select and Place:

microsoft-exams

5 thoughts on “How should you complete the code?

  1. .Split() argument must be a char.

    string settings = “value1;value2”;

    foreach (string val in settings.Split(‘;’))
    {
    Console.WriteLine(val);
    }

    1. it will compile:

      string t = “test1;test2”;

      foreach (var v in t.Split(“;”))
      {
      Console.WriteLine(v);
      }

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.