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

Chr$(13) in .NET?

Does anyone know how to do Chr$(13) in .NET?

Thanks,

Eddie
Nov 16 '05 #1
6 19258
Eddie B. wrote:
Does anyone know how to do Chr$(13) in .NET?

Thanks,

Eddie


If you want a newline, use System.Environment.Newline.
Else, just cast the int to a char.

- Pete
Nov 16 '05 #2
Hi,

Eddie B. wrote:
Does anyone know how to do Chr$(13) in .NET?


Are you sure this does not belong in the VB-NG?

Use the following code in C#:

\\\
const char LineBreak = '\x0D';
// alternatively:
//const char LineBreak = (char)13;
///

--
Konrad -
http://madrat.net/
Nov 16 '05 #3
> Petecwrote:
If you want a newline, use System.Environment.Newline.
Else, just cast the int to a char.

- Pete


Actually, System.Environment.Newline is equivalent to "\r\n".

Chr$(13) is "\r". Chr$(10) is "\n"

Nov 16 '05 #4
Jimi wrote:
[...]
Actually, System.Environment.Newline is equivalent to "\r\n".
That depends on the OS on which the application is running.

On Windows, your statement holds true. However, on *n?x, for example, a
newline is represented by a single '\n' (line-feed).
[...]

Nov 16 '05 #5
C# is most often run on Windows anyway.
"C# Learner" <cs****@learner.here> wrote in message
news:u$**************@tk2msftngp13.phx.gbl...
Jimi wrote:
[...]
Actually, System.Environment.Newline is equivalent to "\r\n".


That depends on the OS on which the application is running.

On Windows, your statement holds true. However, on *n?x, for example, a
newline is represented by a single '\n' (line-feed).
[...]

Nov 16 '05 #6
Fakher Halim wrote:
C# is most often run on Windows anyway.


Maybe, but using System.Environment.NewLine says to the reader of the
code, "Whatever the string for a newline is on the platform this program
will eventually run, I'll use that."

In the case of a network protocol which relies on "\r\n" delimiters, for
example, it's a logical error to use System.Environment.NewLine, for the
above reason.
Nov 16 '05 #7

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

Similar topics

16
by: Eddie B. | last post by:
Does anyone know how to do Chr$(13) in .NET? Thanks, Eddie
6
by: C L Humphreys | last post by:
Hi, I'm trying to concatenate address fields and insert a LF&CR after each line. The SQL I use is based on select address1 & chr(10) & chr(13)& address2 & chr(10) & chr(13)& address3 & ...
1
by: jdph40 | last post by:
I am trying to enter text to look like paragraphs in a text box on a report, making it look like a memo. I enter (Chr$(13) & Chr$(10) & Chr$(10)) to insert a carriage return and 2 line breaks, but...
2
by: lauren quantrell | last post by:
Has anyone cunstructed a function to remove multiple carriage returns and replace it with a single return? Replace(mytext, Chr(13) & Chr(10) & Chr(13) & Chr(10), Chr(13) & Chr(10)) ... only...
2
by: MLH | last post by:
I run the following command in main menu form open event code... Me!MainMenuLabel.Caption = DLookup("", "qryAdminList") & Chr$(10) & Chr$(13) & DLookup("", "qryAdminList") & Chr$(10) & Chr$(13)...
3
by: Alberto | last post by:
In a application in visual basic 6 I had chr$(13). How can I get the same value in C#? Thank you
2
by: crjunk | last post by:
I have the following code in my web page. Dim tmpReplace As String 'Giving tmpReplace the value from the textbox on the webform. tmpReplace = txtComments.Text.Trim 'Prevents report from...
10
by: Dan Nash | last post by:
Lo, In a previous version of an app, I used replace to convert multiline text boxes to something easier to put in a database, and then i used replace(chr(13), "<br>") when i needed to show the...
1
by: Felix | last post by:
We have a problem with the Chr(13) and WebServices (we are using VB.NET 2003). If we have a string that contains the Chr(13) and the Chr(10) (just the vbCrLf characters) and we pass it through a...
5
by: Computer Guru | last post by:
I have a form I'm using as a dialog box. It has default text that is two paragraphs. It has a function setText(byval text as string) that specifies the text in the read-only textbox that's on...
1
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: 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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.