Write() and WriteLine() in C#

I have been following some tutorial of C# and encountered an issue of Write() and WriteLine() function. What is the difference between them?

They both print text on the console, but they operate differently based on new line character. Write() display the text without providing a new line character; whereas WriteLine() provides us with a new line character.

Talk Is Cheap, Show Me The Code


Console Output


Line 3 and line 4 is not on the same line, as WriteLine() provides a new line character. There is no pro and con between these two functions; it really depends on the purpose of your code.



9 Replies to “Write() and WriteLine() in C#”

  1. I wanted to send you the very little remark to finally thank you the moment again over the spectacular techniques you have shared on this page. This has been extremely generous of people like you in giving easily all a few people could have advertised as an e-book in making some bucks for their own end, certainly considering that you could have done it if you considered necessary. The concepts additionally acted as a easy way to be certain that many people have a similar desire just as mine to figure out a great deal more concerning this condition. Certainly there are a lot more enjoyable instances ahead for folks who check out your blog.

  2. Thank you for your entire labor on this web site. My aunt really likes going through investigations and it’s really obvious why. Most of us learn all of the lively method you offer practical strategies through this web site and even increase participation from some other people on the issue so our favorite girl is in fact learning a lot of things. Take advantage of the rest of the year. You are always doing a really good job.

  3. A lot of thanks for all your efforts on this site. Gloria loves engaging in investigation and it’s easy to understand why. Almost all know all concerning the dynamic means you deliver helpful items on the web blog and as well encourage contribution from other people on that concern plus our daughter is actually discovering a lot. Have fun with the remaining portion of the new year. You’re the one conducting a good job.

  4. My husband and i felt now fortunate Emmanuel could conclude his investigation from your ideas he gained in your site. It’s not at all simplistic just to choose to be giving for free information that most people have been making money from. And we all do understand we have the website owner to be grateful to because of that. The explanations you’ve made, the easy site menu, the friendships you can give support to engender – it’s everything extraordinary, and it’s facilitating our son and our family feel that that idea is enjoyable, and that is highly important. Many thanks for all the pieces!

  5. I’m just commenting to let you be aware of of the excellent discovery my cousin’s child enjoyed going through your blog. She discovered a wide variety of details, most notably how it is like to have a very effective coaching heart to get many more effortlessly fully understand certain complicated matters. You actually did more than my desires. I appreciate you for displaying such great, healthy, educational and also cool guidance on that topic to Evelyn.

  6. I am commenting to let you know of the fantastic encounter my cousin’s daughter experienced reading your site. She even learned many issues, not to mention what it’s like to have a wonderful giving mindset to have many people just grasp chosen grueling subject areas. You really exceeded our expectations. Many thanks for distributing the informative, healthy, educational and as well as easy thoughts on the topic to Jane.

  7. My wife and i have been really more than happy when Louis managed to finish off his researching using the precious recommendations he made through your web site. It is now and again perplexing to simply find yourself making a gift of strategies which often some other people may have been trying to sell. Therefore we realize we need the writer to give thanks to for this. The specific illustrations you made, the straightforward web site navigation, the relationships you will help to instill – it is most remarkable, and it is leading our son in addition to us reckon that this subject is interesting, which is seriously pressing. Thanks for the whole lot!

  8. Thanks for the tips on credit repair on all of this blog. What I would advice people is to give up the mentality that they can buy now and pay later. As a society we tend to do this for many things. This includes vacations, furniture, and items we want. However, you need to separate your wants from all the needs. While you are working to improve your credit score you have to make some sacrifices. For example you can shop online to save money or you can go to second hand stores instead of expensive department stores for clothing.

Leave a Reply

Your email address will not be published. Required fields are marked *