473,320 Members | 1,914 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

vbNewLine or ControlChars.NewLine

Lou
Which is more efficient?
-Lou
Nov 22 '07 #1
3 5297
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.

"Lou" <lo********@comcast.netwrote in message
news:OX****************@TK2MSFTNGP06.phx.gbl...
Which is more efficient?
-Lou
Nov 22 '07 #2
Lou
cool!
Thanks.

"Stephany Young" <noone@localhostwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
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.

"Lou" <lo********@comcast.netwrote in message
news:OX****************@TK2MSFTNGP06.phx.gbl...
>Which is more efficient?
-Lou

Nov 23 '07 #3
"Stephany Young" <noone@localhostschrieb:
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.

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

Nov 23 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Simon | last post by:
Hi all, Does anyone know what is equivalent to ControlChars class in C#? Thank you Simon
9
by: Alan Mackenzie | last post by:
To all those who use (X)Emacs's CC Mode to edit C, C++, Java, Objective-C, Pike, AWK or IDL: To help direct the development of CC Mode, it would be useful to find out how people use the...
8
by: kerberoz | last post by:
whats the equivalent following ControlChars.Lf, ControlChars.Cr, ControlChars.CrLf code in vb.net
4
by: Peter Kirk | last post by:
Hi I would like to ask a little bit about the value Environment.Newline: what is it and what is the point of it? Ok, I can see in the docs that it represents "newline" for the current platform -...
5
by: Adam Right | last post by:
Hi, Is there a way to construct the mail body including newline characters by using .net framework mailing functions when sending an email? I cannot insert newline character into the body of the...
6
by: SLH | last post by:
if i have a text area on a page that i want to validate, and i dont want there to ever be 2 "enter"s in a row, how can i check for this? ive been playing with something like: If InStr(string,...
11
by: rossum | last post by:
I want to declare a const multi-line string inside a method, and I am having some problems using Environment.NewLine. I started out with: class foo { public void PrintStuff() { const...
1
by: linq936 | last post by:
Hi, I read in many places that the string to be outputted by printf() must be ending with newline, for example, it should be printf("Hello World.\n"); instead of printf("Hello World.");
1
by: sunilkds | last post by:
I am using MSFlexGridcontrol.In that i want input value in to next line of the row @ run time in a single row I used VBNEWLINE ,but i didnt get correct result.. My code is Do Until rec.EOF...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.