By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,567 Members | 1,605 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,567 IT Pros & Developers. It's quick & easy.

ctrl line-feed

P: n/a
Tim
How do I create a string that contains a carriage return line feed in the
middle. For example:

"string 1" + crlf + "string 2"

would output:
string1
string2

Thanks in advance for your help.
Nov 15 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"string 1\r\nstring 2"
\r is CR
\n is LF

"Tim" <ti******@yahoo.com> a écrit dans le message de
news:%2****************@tk2msftngp13.phx.gbl...
How do I create a string that contains a carriage return line feed in the
middle. For example:

"string 1" + crlf + "string 2"

would output:
string1
string2

Thanks in advance for your help.

Nov 15 '05 #2

P: n/a
You can also use Environment.NewLine that will also work for richtexboxes
and console, etc.

--
William Stacey, MVP

"Tim" <ti******@yahoo.com> wrote in message
news:#A**************@tk2msftngp13.phx.gbl...
How do I create a string that contains a carriage return line feed in the
middle. For example:

"string 1" + crlf + "string 2"

would output:
string1
string2

Thanks in advance for your help.

Nov 15 '05 #3

P: n/a
William Stacey <st***********@mvps.org> wrote:
You can also use Environment.NewLine that will also work for richtexboxes
and console, etc.


However, be warned that that may not be CRLF on some platforms. When
CRLF is called for by a protocol, you should use \r\n, not
Environment.NewLine.

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

This discussion thread is closed

Replies have been disabled for this discussion.