CodeWalker
CodeWalker

Reputation: 2368

How do I print text in same line?

I am new to C#. While displaying text, C# prints every piece of text in a new line. But, I would like have all the pieces in the same line like Four Hundred Fifty Eight; kindly refer to the image below.
What should I do ?

enter image description here

Upvotes: 3

Views: 30998

Answers (4)

Uladzimir Simankou
Uladzimir Simankou

Reputation: 116

You could terminate the string forcibly, like this

Debug.Print("{0:X} \0", byteReceived[0]);

Then new .Print after that would be in the same line.

Upvotes: 0

Moustachauve
Moustachauve

Reputation: 191

You can use Console.Write() instead of Console.WriteLine()

Upvotes: 2

Jeff Zarnett
Jeff Zarnett

Reputation: 136

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

Upvotes: 12

keeehlan
keeehlan

Reputation: 8054

Assuming you're using Console.WriteLine(), all you need to do is use Console.Write() instead.

Upvotes: 4

Related Questions