To create a string literal exclude escape sequence, use:

  1. !string

  2. @string

  3. #string

  4. $string


Correct Option: B

AI Explanation

To answer this question, we need to understand how to create a string literal in programming.

A string literal is a sequence of characters enclosed in quotation marks. In some programming languages, certain characters within a string may have special meaning and need to be escaped using escape sequences.

In the given question, we are looking for the option that allows us to create a string literal without using any escape sequences.

Option A) !string - This option is incorrect because it does not follow the syntax for creating a string literal.

Option B) @string - This option is correct because in some programming languages, such as C#, the '@' symbol before a string literal allows us to create a verbatim string literal. In a verbatim string literal, escape sequences are not processed, and the string is interpreted exactly as it is written.

Option C) #string - This option is incorrect because it does not follow the syntax for creating a string literal.

Option D) $string - This option is incorrect because it does not follow the syntax for creating a string literal.

The correct answer is B) @string. This option is correct because it allows us to create a string literal without using any escape sequences.

Find more quizzes: