PC Review


Reply
Thread Tools Rate Thread

C# Line Feed

 
 
Aaron
Guest
Posts: n/a
 
      15th Nov 2004
Real basic question here. Since I'm new to C#, how do I code a line feed
for text. I want to have several paragraphs in a text box and need some
space between them. Also, please respond with how to concatenated the two
strings together along with the line feeds. From what I remember from my
C++ days it was always \n and with an ANSI string I could always do
something like "String1" + \n\n + "String2"; but apparently that doesn't
work in C#

Thanks


 
Reply With Quote
 
 
 
 
Tim Wilson
Guest
Posts: n/a
 
      15th Nov 2004
See the thread linked below.
http://www.google.ca/groups?hl=en&lr...0a%2540phx.gbl

To concatenate strings just use the "+".
string s = "Hello" + ", " + "World";

--
Tim Wilson
..Net Compact Framework MVP

"Aaron" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Real basic question here. Since I'm new to C#, how do I code a line feed
> for text. I want to have several paragraphs in a text box and need some
> space between them. Also, please respond with how to concatenated the two
> strings together along with the line feeds. From what I remember from my
> C++ days it was always \n and with an ANSI string I could always do
> something like "String1" + \n\n + "String2"; but apparently that doesn't
> work in C#
>
> Thanks
>
>



 
Reply With Quote
 
Chris Tacke, eMVP
Guest
Posts: n/a
 
      15th Nov 2004
Carriage Return = \r
New Line = \n

You need both: \r\n

so Console.WriteLine("Hello\r\nWorld");

--
<ctacke/>
www.OpenNETCF.org
Your CF searches start and end here


"Aaron" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Real basic question here. Since I'm new to C#, how do I code a line feed
> for text. I want to have several paragraphs in a text box and need some
> space between them. Also, please respond with how to concatenated the two
> strings together along with the line feeds. From what I remember from my
> C++ days it was always \n and with an ANSI string I could always do
> something like "String1" + \n\n + "String2"; but apparently that doesn't
> work in C#
>
> Thanks
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Challenge - Excel Line Feed Character CHR(10) - How to Delete and keep the text formatting without going ro single line in a cell ? Microsoft Excel Programming 6 7th Oct 2009 12:28 PM
Excel Line Feed Character - How to delete the CHR(10) and keep the formatting without going to single line.. Microsoft Excel Discussion 7 7th Oct 2009 11:13 AM
Challenge - Excel Line Feed Character CHR(10) - How to Delete and keep the text formatting without going ro single line in a cell ? Microsoft Excel Worksheet Functions 7 7th Oct 2009 11:10 AM
Report Text Box Force Line Carriage Return and Line Feed Dwade Microsoft Access Reports 1 9th Apr 2009 08:48 PM
how does excel store new line and line feed characters? ben h Microsoft Excel Programming 0 1st Jul 2004 02:34 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:41 AM.