Share via


Multi-Line statement

Question

Tuesday, January 10, 2006 9:12 PM

How to write statements running into multi-lines in C#, like using "_" in vb6.

All replies (3)

Tuesday, January 10, 2006 11:35 PM ✅Answered

Just do it.  You can use as many lines as you like, so long as you're not inside a string literal at the time.

 


Wednesday, January 11, 2006 8:07 AM ✅Answered

Here are some examples.


string myString = "Please, this is line1. " +
"here is line2";

string message = ( status > 0 ?
                   "Done" :
                   "Error" );

MyMethod( myString,
          message,
          null );
 

Wednesday, January 11, 2006 11:31 AM

Thank you :)