Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
You know how we have an object called a MessageBox? I've been trying to make a new line. For example when you press enter in a notepad program, the blinking line goes down one?

Here's what I'm trying to do (in plain English):

1. This is an example of what I'm asking

2. This is an example
of what I'm asking

You see how example 1. is all in one line. How can I break up the line to put a certain portion of the sentence one line below? Like in example 2?
Posted
Comments
Kornfeld Eliyahu Peter 27-Mar-14 10:03am    
\n
[no name] 27-Mar-14 10:08am    
Environment.NewLine

As Kornfeld mentioned, all you need is a "\n" in your output.
 
Share this answer
 
Just add Newline in the middle ;)
C#
string.Format("{0}\n{1}",textInFirstLine, textInSecondLine);

or
C#
string.Format("{0}{1}{2}",textInFirstLine, Enviroment.NewLine, textInSecondLine);


Cheers!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900