Is there a way to delete a character that has just been written using Console.WriteLine?

"\b" is ASCII backspace. Print it to back up one char.

Console.Write("Abc");
Console.Write("\b");
Console.Write("Def");

outputs "AbDef";

As pointed out by Contango and Sammi, there are times where overwriting with a space is required:

Console.Write("\b \b");

Console.Write("\b \b"); is probably what you want. It deletes the last char and moves the caret back.

The \b backspace escape character only moves the caret back. It doesn't remove the last char. So Console.Write("\b"); only moves the caret one back, leaving the last character still visible.

Console.Write("\b \b"); however, first moves the caret back, then writes a whitespace character that overwrites the last char and moves the caret forward again. So we write a second \b to move the caret back again. Now we have done what the backspace button normally does.


This will do the trick if you use Write instead of WriteLine.

Console.Write("List: apple,pear,");
Console.Write("\b");  // backspace character
Console.WriteLine(".");

But you actually have lots of control over the console. You can write to any location you wish. Just use the Console.SetCursorPosition(int, int) method.