How can I update the current line in a C# Windows Console App?

前端 未结 17 1052
南旧
南旧 2020-11-22 14:43

When building a Windows Console App in C#, is it possible to write to the console without having to extend a current line or go to a new line? For example, if I want to sho

17条回答
  •  失恋的感觉
    2020-11-22 15:30

    \r is used for these scenarios.
    \r represents a carriage return which means the cursor returns to the start of the line.
    That's why Windows uses \n\r as its new line marker.
    \n moves you down a line, and \r returns you to the start of the line.

提交回复
热议问题