I want to output some characters in C# console application and then rewrite them, thus changing characters in position already occupied in command window. So for for example I could show progress in percentages 10%, 20%, 30% (but in the same place). How can I do that?
Asked
Active
Viewed 1,545 times
2 Answers
4
Community
- 1
- 1
Adriaan Stander
- 156,697
- 29
- 278
- 282
2
If you print a '\r' character, the cursor will return back to the current line, e.g.
Console.Write("10%\r");
// then..
Console.Write("20%\r");
izb
- 48,023
- 39
- 114
- 167