I’m trying to create a string that is something like this
string myStr = "CREATE TABLE myTable
(
id text,
name text
)";
But I get an error:
https://i.stack.imgur.com/o6MJK.png
What is going on here?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Make a verbatim string by prepending an at sign (
@). Normal string literals can’t span multiple lines.Note that within a verbatim string (introduced with a
@) the backslash (\) is no more interpreted as an escape character. This is practical for Regular expressions and file pathsThe double quote must be doubled to be escaped now
Starting with C# 11, we can use raw string literals. They allow you to preserve the indentation of your code while the indentation white spaces are not added to content of the string itself. In the following example
CREATEis left aligned on the first line of the string. The position of the ending"""marks the left edge of the string. The end of the string is)with no line-break following it. The double quotes need not to be escaped.