Long lines of code - help!

  • Thread starter Thread starter Frank
  • Start date Start date
F

Frank

Hi,

Probably a silly question, but can't find it!!

In C++ when you have a long line of code you can use
the "\" character to continue the line of code on the
next line in the editor. In Visual Basic you can use
the "_" char.

How do you do this in C# ??
 
Frank said:
In C++ when you have a long line of code you can use
the "\" character to continue the line of code on the
next line in the editor. In Visual Basic you can use
the "_" char.

As far as I know, the \ character in C++ is only used in macros. C++ (and
C#) compilers ignore newlines in source code, as the function delimiter is
';' (unlike Visual Basic, where it is the newline character).

You can format the code as you want, without writing any special character

Console.
WriteLine
(
"Hello"
+ " this is a line"
)
;

is perfectly valid in C#

hope this helps

Javier Campos
Virtual Media Systems, S.L.
 
Back
Top