I have a string and I want to write it over multiple line, hover I don't want to write it the below way since it would be tedious
val = " lines 1 "
+ " lines +
....
any idea?
I have a string and I want to write it over multiple line, hover I don't want to write it the below way since it would be tedious
val = " lines 1 "
+ " lines +
....
any idea?
You can try the following:
str tmp =
@"123
456
789";
Note the text is aligned all the way to the edge of the editor, otherwise those indentations/spaces will be included in the string.
If that not what you looking for, then maybe TextBuffer
class will be suitable for your needs.
Try with a backslash at the end of the line like this
str tmp;
;
tmp = "123\
456\
789";
Note: The leading spaces in the lines are part of the string, so the result is not
"123456789"
but "123 456 789"