473,387 Members | 1,693 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,387 software developers and data experts.

VBCRLF in C#

How do i convert VBCRFL in Csharp?

thanks
Nov 15 '05 #1
8 36505
Environment.NewLine

José
"Murali Inguva" <mi*****@hotmail.com> a écrit dans le message de
news:uY**************@TK2MSFTNGP11.phx.gbl...
How do i convert VBCRFL in Csharp?

thanks

Nov 15 '05 #2
Murali:

Like José said, Environment.NewLine is
the best way for general use.

In certain circumstances (writing files for other
platforms) it's necessary to control how a newline
is created.

Environment.NewLine basically returns a
Carriage Return (CR, 0x13) and a
Linefeed(LF, 0x10). Carriage return moves the
cursor back to column 0, and Linefeed moves
the cursor to the next row.

Windows generally uses CRLF to represent a
new line. Unix/Linux just uses LF, and
MacOS used to use CR. Now adays, most
platforms can use anything, but if you
open a Unix file in Notepad, for example,
you won't see the line breaks, everything
will be on one line.

In C#, you can represent these special
characters as "escape" characters. For
example, \r is CR, \n LF, \t TAB, \0 null,
etc.

If you want a CRLF in your string, you'd
do this:

string foo = "This is some text\r\nNew Line!";

But for the cases where you don't need
a special platform specific code, use
Environment.NewLine.

-c

"José Joye" <jose.joye@__No_SPam__bluewin__maPS_oN__.ch> wrote in
message news:%2****************@TK2MSFTNGP10.phx.gbl...
Environment.NewLine

José
"Murali Inguva" <mi*****@hotmail.com> a écrit dans le message de
news:uY**************@TK2MSFTNGP11.phx.gbl...
How do i convert VBCRFL in Csharp?

thanks


Nov 15 '05 #3
On Tue, 2 Sep 2003 15:21:36 -0400, "Murali Inguva"
<mi*****@hotmail.com> wrote:
How do i convert VBCRFL in Csharp?


vbCrLf = '\n' or "\n" (for use in strings and stuff)

--
NULL
Nov 15 '05 #4
Thanks for your information
Coud you please let me for VBTab Also
I dont want like "\t".

"Chad Myers" <cm****@N0.SP.AM.austin.rr.com> wrote in message
news:uM**************@TK2MSFTNGP10.phx.gbl...
Murali:

Like José said, Environment.NewLine is
the best way for general use.

In certain circumstances (writing files for other
platforms) it's necessary to control how a newline
is created.

Environment.NewLine basically returns a
Carriage Return (CR, 0x13) and a
Linefeed(LF, 0x10). Carriage return moves the
cursor back to column 0, and Linefeed moves
the cursor to the next row.

Windows generally uses CRLF to represent a
new line. Unix/Linux just uses LF, and
MacOS used to use CR. Now adays, most
platforms can use anything, but if you
open a Unix file in Notepad, for example,
you won't see the line breaks, everything
will be on one line.

In C#, you can represent these special
characters as "escape" characters. For
example, \r is CR, \n LF, \t TAB, \0 null,
etc.

If you want a CRLF in your string, you'd
do this:

string foo = "This is some text\r\nNew Line!";

But for the cases where you don't need
a special platform specific code, use
Environment.NewLine.

-c

"José Joye" <jose.joye@__No_SPam__bluewin__maPS_oN__.ch> wrote in
message news:%2****************@TK2MSFTNGP10.phx.gbl...
Environment.NewLine

José
"Murali Inguva" <mi*****@hotmail.com> a écrit dans le message de
news:uY**************@TK2MSFTNGP11.phx.gbl...
How do i convert VBCRFL in Csharp?

thanks



Nov 15 '05 #5
Murali Inguva <mi*****@hotmail.com> wrote:
Coud you please let me for VBTab Also
I dont want like "\t".


What do you mean by you 'dont want like "\t"' exactly?

\t *is* how tab is escaped in C#. So a line with a tab in it might be
something like:

string x = "first bit\tsecond bit";

You can always make your own name for that if you want:

const string Tab="\t";

and then use

string x = "first bit" + Tab + "second bit";

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Nov 15 '05 #6
I'm sorry, I don't understand your English,
I'm not sure what you're asking.

You don't like \t and you want a different
way to make a tab? I'm not sure there is
a way.

0x9 is the tab char, you could do something
like:

string foo = ((char)9) + "Intended text";

But I think that this looks much better:

string foo = "\tIndented text";

but that's just me :)

-c

"Murali Inguva" <mi*****@hotmail.com> wrote in message
news:OF**************@TK2MSFTNGP12.phx.gbl...
Thanks for your information
Coud you please let me for VBTab Also
I dont want like "\t".

"Chad Myers" <cm****@N0.SP.AM.austin.rr.com> wrote in message
news:uM**************@TK2MSFTNGP10.phx.gbl...
Murali:

Like José said, Environment.NewLine is
the best way for general use.

In certain circumstances (writing files for other
platforms) it's necessary to control how a newline
is created.

Environment.NewLine basically returns a
Carriage Return (CR, 0x13) and a
Linefeed(LF, 0x10). Carriage return moves the
cursor back to column 0, and Linefeed moves
the cursor to the next row.

Windows generally uses CRLF to represent a
new line. Unix/Linux just uses LF, and
MacOS used to use CR. Now adays, most
platforms can use anything, but if you
open a Unix file in Notepad, for example,
you won't see the line breaks, everything
will be on one line.

In C#, you can represent these special
characters as "escape" characters. For
example, \r is CR, \n LF, \t TAB, \0 null,
etc.

If you want a CRLF in your string, you'd
do this:

string foo = "This is some text\r\nNew Line!";

But for the cases where you don't need
a special platform specific code, use
Environment.NewLine.

-c

"José Joye" <jose.joye@__No_SPam__bluewin__maPS_oN__.ch> wrote in
message news:%2****************@TK2MSFTNGP10.phx.gbl...
Environment.NewLine

José
"Murali Inguva" <mi*****@hotmail.com> a écrit dans le message de
news:uY**************@TK2MSFTNGP11.phx.gbl...
> How do i convert VBCRFL in Csharp?
>
> thanks
>
>



Nov 15 '05 #7
"Jon Skeet" <sk***@pobox.com> wrote in message
news:MP************************@news.microsoft.com ...
You can always make your own name for that if you want:

const string Tab="\t";

and then use

string x = "first bit" + Tab + "second bit";


How bout csTab? ;)

-c
Nov 15 '05 #8
Thanks for your information
Coud you please let me for VBTab Also
I dont want like "\t".

"Chad Myers" <cm****@N0.SP.AM.austin.rr.com> wrote in message
news:uM**************@TK2MSFTNGP10.phx.gbl...
Murali:

Like José said, Environment.NewLine is
the best way for general use.

In certain circumstances (writing files for other
platforms) it's necessary to control how a newline
is created.

Environment.NewLine basically returns a
Carriage Return (CR, 0x13) and a
Linefeed(LF, 0x10). Carriage return moves the
cursor back to column 0, and Linefeed moves
the cursor to the next row.

Windows generally uses CRLF to represent a
new line. Unix/Linux just uses LF, and
MacOS used to use CR. Now adays, most
platforms can use anything, but if you
open a Unix file in Notepad, for example,
you won't see the line breaks, everything
will be on one line.

In C#, you can represent these special
characters as "escape" characters. For
example, \r is CR, \n LF, \t TAB, \0 null,
etc.

If you want a CRLF in your string, you'd
do this:

string foo = "This is some text\r\nNew Line!";

But for the cases where you don't need
a special platform specific code, use
Environment.NewLine.

-c

"José Joye" <jose.joye@__No_SPam__bluewin__maPS_oN__.ch> wrote in
message news:%2****************@TK2MSFTNGP10.phx.gbl...
Environment.NewLine

José
"Murali Inguva" <mi*****@hotmail.com> a écrit dans le message de
news:uY**************@TK2MSFTNGP11.phx.gbl...
How do i convert VBCRFL in Csharp?

thanks




Nov 15 '05 #9

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

Similar topics

7
by: Jason | last post by:
When users fill out my text area field, there is a chance that there will be no line feeds or cariage returns or spaces and just one really long word. THIS CAUSES A MAJOR PROBLEM! What I am trying...
2
by: Techy | last post by:
I have used thecode which is below to get x characters on to display <%= LEFT(rsName.Fields.Item("columnname").Value,50)%> It works fine but when I use this same code to get x characters plus...
1
by: techy techno | last post by:
I have used thecode which is below to get x characters on to display <%= LEFT(rsName.Fields.Item("columnname").Value,50)%> It works fine but when I use this same code to get x characters plus...
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...
0
by: Jim in Arizona | last post by:
Is there an easier way to make a datalist aware of line breaks within text fields? I have a text box that users can type into. If they press the enter key a few times, VB sees this as a vbCrLf....
14
by: dancer | last post by:
What is this? vbCrLf
3
by: wildman | last post by:
Is there any way for gridview cells to observe vbcrlf in the data? I attempted to do this, but it does not seem to work. Dim dgItem As GridViewRow For Each dgItem In gridCollaborator.Rows...
1
by: Jim in Arizona | last post by:
On one page I have a datalist where a message is bound to a label. On another page I have the datalist which allows for the insert of new message as well as being able to edit those messages. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.