[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

newline in a string

Posted on 2007-12-06
8
Medium Priority
?
968 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:Tom Knowlton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 22

Accepted Solution

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

\n
0
 
LVL 5

Author Comment

by:Tom 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Author Comment

by:Tom 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:Tom 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:Tom 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:Tom 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

656 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