I’m creating an application using Visual Studio 2010 C#.
I have a string in-line in my code which causes the code to not compile. The string contains line breaks and so spans over multiple lines, rather than being on a single line.
What should I do so that I can keep the string with the line breaks but also make my code compile?
I think you need to use the
@sign before your string to allow it to be treated as a string literal and span multiple lines.if your string contains the
"character they need to be doubled as I don’t think that escaping will work in a string literal:read more about string literals in the spec here