Recall & Review
beginner
What is a verbatim string literal in C#?
A verbatim string literal starts with @ and allows the string to include backslashes and new lines exactly as typed, without needing escape sequences.
Click to reveal answer
beginner
How do you write a multi-line string in C# using verbatim literals?
Use @ before the opening quote and write the string across multiple lines. For example:
@"Line 1 Line 2"preserves the line breaks.
Click to reveal answer
intermediate
What is a raw string literal in C# 11 and later?
A raw string literal uses triple quotes ("""), allowing multi-line strings with no escape sequences, preserving all characters exactly as typed.
Click to reveal answer
intermediate
How do you include double quotes inside a verbatim string literal?
Double the double quotes inside the string. For example:
@"She said, ""Hello!"""outputs: She said, "Hello!"
Click to reveal answer
intermediate
What is the main difference between verbatim and raw string literals in C#?
Verbatim strings start with @ and require doubling quotes to escape them, while raw string literals use triple quotes and allow easier multi-line strings with embedded quotes without doubling.
Click to reveal answer
Which symbol starts a verbatim string literal in C#?
✗ Incorrect
Verbatim strings start with @ before the opening quote.
How do you write a raw string literal in C# 11?
✗ Incorrect
Raw string literals use triple double quotes """ to start and end the string.
How do you include a double quote inside a verbatim string literal?
✗ Incorrect
Inside verbatim strings, double quotes are included by doubling them.
Which of these is true about raw string literals?
✗ Incorrect
Raw string literals preserve all characters exactly as typed, including new lines and quotes.
What is the output of this verbatim string? @"C:\Users\Admin"
✗ Incorrect
Verbatim strings treat backslashes literally, so the output is C:\Users\Admin with single backslashes.
Explain how verbatim string literals work in C# and how they help with file paths.
Think about how Windows file paths use backslashes.
You got /4 concepts.
Describe the advantages of raw string literals introduced in C# 11 compared to verbatim strings.
Consider how raw strings simplify writing complex strings.
You got /4 concepts.