Þessi vafri er ekki lengur studdur.
Uppfærðu í Microsoft Edge til að nýta þér nýjustu eiginleika, öryggisuppfærslur og tæknilega aðstoð.
Which of the following escape sequences should be used to add double quotes to a literal string in C# code?
'\q'
\q
'\''
\'
'\"'
\"
Which of the following lines of code correctly uses string interpolation assuming that the variable value is a string?
value
'Console.WriteLine(@"My value: {value}");'
Console.WriteLine(@"My value: {value}");
'Console.WriteLine($"My value: {value}");'
Console.WriteLine($"My value: {value}");
'Console.WriteLine(@"My value: [value]");'
Console.WriteLine(@"My value: [value]");
Unicode characters were embedded in the C# strings for a console application to present a greeting message in Thai. However, the message is only displayed as question mark characters. What is a possible cause?
A missing \u escape sequence for Unicode characters.
The wrong Unicode characters were used.
The user's console doesn't support Unicode characters.
Which of the following lines of code appends a single \ to the string directory?
\
directory
'directory = directory + "\";'
directory = directory + "\";
'directory = directory + '\';'
directory = directory + '\';
'directory = directory + @"\";'
directory = directory + @"\";
You must answer all questions before checking your work.
Var þessi síða gagnleg?
Þarftu hjálp með þetta efni?
Viltu prófa að nota Ask Learn til að skýra eða leiðbeina þér í gegnum þetta efni?