vbNewLine or ControlChars.NewLine

  • Thread starter Thread starter Lou
  • Start date Start date
Neither are more efficient as they are both constants.

But ...

Environment.NewLine

is more correct as it represents whatever a newline actually is on the
machine/OS where the program is executing.
 
cool!
Thanks.

Stephany Young said:
Neither are more efficient as they are both constants.

But ...

Environment.NewLine

is more correct as it represents whatever a newline actually is on the
machine/OS where the program is executing.
 
Stephany Young said:
Neither are more efficient as they are both constants.

But ...

Environment.NewLine

is more correct as it represents whatever a newline actually is on the
machine/OS where the program is executing.

I don't think it is "more correct" in general. Which one is more correct
depends on the exact scenario. Would you expect a Windows Forms
implementation for UNIX use CR+LF as Windows does or would you expect it to
use the system's "native" new line sequence? Note that data displayed in
controls, for example, can be loaded from resources too. Changing the new
line character sequence based on the system would make porting applications
between different operating systems harder.
 
Back
Top