Click here to Skip to main content
15,909,827 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Coding:

string sItem = text11.Text + text21.Text;

O/P:

sItem:Text1Text2

But i want Text2 in second line..,
Posted
Comments
George Jonsson 26-Nov-14 0:23am    
How do you show the string sItem in your GUI?
Show a little more of your code.
Inserting a NewLine between two strings should work.

1 solution

You can use:

StringBuilder sb = new StringBuiler();
sb.AppendLine(text11.Text);
sb.AppendLine(text21.Text);

sItem = sb.ToString();

or:

sItem = text11.Text + System.Environment.NewLine + text21.Text;
 
Share this answer
 
Comments
safihur Rahuman 25-Nov-14 23:38pm    
sItem = text11.Text + System.Environment.NewLine + text21.Text;

this one not work..,
Same o/p is come..,
safihur Rahuman 25-Nov-14 23:45pm    
Dear frd,

first one also is not work.., sane o/p is come sItem:Text1Text2

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



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