i didn't understand the difference between concole.write and writeline | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

i didn't understand the difference between concole.write and writeline

11th Oct 2016, 5:14 PM
sd1327
2 Answers
+ 6
Console.WriteLine() prints out the text you put in, and then sets the cursor to the next line. It's like if you typed something in a text editor and then pressed Enter. Console.Write() prints out the text, but the cursor stays in the same place. It won't add any spaces or new lines.
12th Oct 2016, 12:08 AM
Tamra
Tamra - avatar
+ 4
.write() is a static method that write the argument and stay on the same line. With. Writeline() the method print the argument and go in the line under! The difference is just layout thing
11th Oct 2016, 6:28 PM
Riccardo S
Riccardo S - avatar