I believe it generally makes most sense to use Environment.NewLine
as the new-line identifier, for a number of reasons:
- It is an environment-dependent read-only variable. If you happen to be running your program on Linux (for example), then the value will simply be
.
vbCrLf
is a legacy constant from the VB6 and earlier languages. Also, it's not environment-independent.
has the same issue of not being environment-dependent, and also can't be done nicely in VB.NET (you'd have to assign a variable to Chr(13) & Chr(10)
).
- Controls exists in the
Microsoft.VisualBasic
namespace, effectively making it a legacy/backwards-compatibility option, like vbCrLf
. Always stay clear of legacy code if possible.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…