Search code examples
c#linebreakendl

How we can add a new line in c#


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"


Solution

  • "my name is " + "\n" + "yazdan" 
    

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