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:
.Split() argument must be a char.
string settings = “value1;value2”;
foreach (string val in settings.Split(‘;’))
{
Console.WriteLine(val);
}
the answer compiles with target 4 ‘;’ not “;”
Correct.
Split does not accepts alone string parameter. The answer will not compile
it will compile:
string t = “test1;test2”;
foreach (var v in t.Split(“;”))
{
Console.WriteLine(v);
}