Multiple choice technology programming languages

Which of these string definition will prevent escaping on backslashes in C#?

  1. string s= #"Test string";

  2. string s= ."Test string";

  3. string s= @"Test string";

  4. string s= &"Test string";

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

In C#, the @ prefix before a string literal creates a verbatim string where backslashes are treated literally (not as escape characters). For example: @"C:\path" is interpreted as-is. The # prefix is used for preprocessor directives like #if. The . and & characters have no special meaning as string prefixes. Only @ creates verbatim strings.