Re: vbCrLf
- From: "Herfried K. Wagner [MVP]" <hirf-spam-me-here@xxxxxx>
- Date: Fri, 22 Sep 2006 15:43:59 +0200
"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/>
.
- Follow-Ups:
- Re: vbCrLf
- From: Josip Medved
- Re: vbCrLf
- References:
- vbCrLf
- From: Chris
- Re: vbCrLf
- From: Josip Medved
- vbCrLf
- Prev by Date: Re: Foreign letters in text file
- Next by Date: Re: Which is the better construct?
- Previous by thread: Re: vbCrLf
- Next by thread: Re: vbCrLf
- Index(es):