New line in code line

in c ++ it

string x = "hello \
Hello";

it \

in C # I really don’t know :), but \ does not work, and I can not find the information. This is annoying.

+3
source share
2 answers
string x = @"Hello
world";
+2
source

Prefix your string with the @ symbol so that the newline character is included in the string.

string x = @"hello 
Hello";
+4
source

Source: https://habr.com/ru/post/1736441/


All Articles