How can I print a line in the console without a new line at the end?

My question is.

what do you type when you want to get an answer next to your question in C #

I mean like that, but you enter the answer next to the question.

string product; Console.WriteLine("What is the product you want?"); product = Console.ReadLine(); 
+10
source share
5 answers

Instead of using Console.WriteLine() use Console.Write()

+21
source
 string product; Console.Write("What is the product you want?"); product = Console.ReadLine(); 
+4
source

I believe you are looking for Console.Write("your text here"); , not Console.WriteLine("your text here");

+3
source

It looks like you are trying to get rid of a new line.

WriteLine prints a new line.
Write does not work.

+2
source

like spaces between them

0
source

All Articles