Adding new line to console output
In console application we write the statement as
Console.WriteLine("the addition is {0}",i)
it gives the o开发者_如何转开发utput
addition is 50
Now my question is: I want the answer to appear like this:
addition is
50
How I will assign the output to the next line?
Console.WriteLine("The addition is, {0} {1}", _
Environment.NewLine, i)
I agree with rdkleine. Punctuation in your question would be very helpful. But, I'm going to step out on a limb and assume you mean, how can I add a line break to the output using Console.WriteLine.
Use vbcrlf to generate a line break.
Console.WriteLine("The addition is" & vbCrLf & "{0}", i)
Agree with Josaph, but I would do so like this:
Console.Writeline("The addition is{0}", vbCrLf & i)
精彩评论