473,320 Members | 1,799 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.

What is vbCrLf counterpart in C#

Hi, friends,

In VB, there is a vbCrLf for a new line. What is the counterpart in C#?
Thanks.
Nov 17 '05 #1
6 30308
Andrew wrote:
Hi, friends,

In VB, there is a vbCrLf for a new line. What is the counterpart in C#?
Thanks.

"\r\n"

--
Rob Schieber
Nov 17 '05 #2

"Andrew" <An****@discussions.microsoft.com> wrote in message
news:39**********************************@microsof t.com...
Hi, friends,

In VB, there is a vbCrLf for a new line. What is the counterpart in C#?
Thanks.


Environment.NewLine

HTH :)

Mythran

Nov 17 '05 #3
"\n"
or "\r"
or sometimes I have seen both "\r\n"
"Andrew" <An****@discussions.microsoft.com> wrote in message
news:39**********************************@microsof t.com...
Hi, friends,

In VB, there is a vbCrLf for a new line. What is the counterpart in C#?
Thanks.

Nov 17 '05 #4
There is a .NET counterpart: System.Environment.NewLine
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant J#: VB.NET to J# Converter
Clear VB: Cleans up outdated VB.NET code
"Andrew" wrote:
Hi, friends,

In VB, there is a vbCrLf for a new line. What is the counterpart in C#?
Thanks.

Nov 17 '05 #5
Steve <ss*@sss.com> wrote:
"\n"
or "\r"
or sometimes I have seen both "\r\n"


vbCrLf is *always* "\r\n" (the \r is the Cr bit, \n is Lf).

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Nov 17 '05 #6
Mythran <ki********@hotmail.comREMOVETRAIL> wrote:
In VB, there is a vbCrLf for a new line. What is the counterpart in C#?
Thanks.


Environment.NewLine


No - there's a subtle difference there. Environment.NewLine won't
always give you carriage-return-line-feed which I would certainly hope
that vbCrLf will. Instead, it gives you the default newline for the
current system - which on windows is \r\n, but not on some other
platforms (where you might be running Mono or Rotor).

It's always worth making sure you know exactly which one you actually
want - if you're writing text files, Environment.NewLine is probably
correct. If you're dealing with a network protocol which specifies the
line terminator, you should use that.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Nov 17 '05 #7

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

Similar topics

1
by: Jinming Xu | last post by:
Hi Folks, Could any of you please teach me what's the counterpart of Python None in C++ side? Since I need to manipulate a Python None in C++. Thanks a lot, Jinming Xu ...
1
by: Niklas | last post by:
H What is Java Webstart counterpart in .NET Regard /Niklas
6
by: Michael.McD | last post by:
Would anyone know how I might access to the vbCrLf constant. I'd like to use teh following bit of VB code in C#: strFoo.Text.Replace(vbCrLf, chr(10) ) Thanks in advance, Michael McD Ps...
0
by: Joe | last post by:
Hi, I have a simple form that does nothing but emails the whatever user entered in the form fields. The form is working fine and email sent. The problem I am having is in te string that forms...
4
by: Andyza | last post by:
I'm using FileSystemObject to open and write to a tab delimited text file. First, I connect to a database and select some data. Then I create the text file and insert each record in the text...
2
Paks
by: Paks | last post by:
Hello, I have a quick little question about the MySQL-command LEFT(columnName,int). My question is if there's a counterpart in PostgreSQL for this command and what it is? What I want to do is...
14
by: dancer | last post by:
What is this? vbCrLf
4
by: Han | last post by:
Hello I am passing string from dotnet to javascript. ", ', newline characters, and something. So I am using httputility.urlEncode() to make it neat. Now a JS function accepts the encoded string...
1
by: Siegfried Heintze | last post by:
I have a VB.NET program that is working fine from Visual Studio 2005. However, when I try to compile and run it from the cmd.exe prompt, it throws an exception. If this was C++, I would insert...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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
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...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

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.