How we can add a new line in c#

Yazdan Haider picture Yazdan Haider · Jun 16, 2017 · Viewed 35.7k times · Source

How we can write output on second line in c# ??
How we can write the given code into two lines

MessageBox.Show("my name is " + LineBreak, "yazdan" ,
                 MessageBoxButton.OK, MessageBoxIcon.Information);

How we can start a new line after "my name is " and before "yazdan"

Answer

Vicky S picture Vicky S · Jun 16, 2017
"my name is " + "\n" + "yazdan" 

you can use either "\n" or Environment.NewLine