How do I print text in same line?

前端 未结 4 680
温柔的废话
温柔的废话 2021-01-24 15:31

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

相关标签:
4条回答
  • 2021-01-24 16:07

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

    0 讨论(0)
  • 2021-01-24 16:16

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

    0 讨论(0)
  • 2021-01-24 16:19

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

    0 讨论(0)
  • 2021-01-24 16:22

    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.

    0 讨论(0)
提交回复
热议问题