Re: vbCrLf

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"Josip Medved" <jmedved@xxxxxxxxxxx> schrieb:
How can you in vb.net write vbCrLf to a file without using the
visualbasic namespace?

In C# you would just case 10/13 to char and right that. I can't seem to
do that in vb.

Use Environment.NewLine instead. If you wish, you can do
Convert.ToChar(number) thing also.

Both are not exactly the same as "\r\n" in C#. 'Environment.NewLine' returns the system's new line character sequence, which may differ on different operating systems. Thus the compiler cannot perform certain optimizations, which is not necessarily a disadvantage if the platform-sensitivity of the new line character sequence is required. I would also use 'ChrW' instead of 'Convert.ToChar' because it will enable the VB compiler to perform optimizations.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

.