Solved

newline in a string

Posted on 2007-12-06
8
938 Views
Last Modified: 2008-02-01
In C#, I forget how you invoke a NewLine in the middle of a string -- so that the string after the newline appears on a -- uh -- new line.
0
Comment
Question by:knowlton
  • 5
  • 3
8 Comments
 
LVL 22

Accepted Solution

by:
RedKelvin earned 500 total points
ID: 20424523
Hi, use

\n
0
 
LVL 5

Author Comment

by:knowlton
ID: 20424527
or:

Environment.NewLine
0
 
LVL 22

Expert Comment

by:RedKelvin
ID: 20424528
Oh, and there is this too

System.Environment.NewLine;

Open in new window

0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 5

Author Comment

by:knowlton
ID: 20424530
LOL ...  yep!
0
 
LVL 22

Expert Comment

by:RedKelvin
ID: 20424536
snap!

yeah, try this
string str = "this is a" + System.Environment.NewLine + "multi line string";

Open in new window

0
 
LVL 5

Author Comment

by:knowlton
ID: 20424558
Huh.......the newline is not "showing up" in the string.

The string is being assigned to an asp:Label at runtime

What gives?
0
 
LVL 5

Author Comment

by:knowlton
ID: 20424589
Huh.

These seem to work:

<br>

I guess I didn't think that would work in the middle of a string that is going into a Label.Text property.
0
 
LVL 5

Author Comment

by:knowlton
ID: 20424595
"This sentence will have a" + "<br><br>" + " line break in it"

produces:

This sentence will have a

line break in it
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question