Question: I am wondering how one can write a program to do something like:

> 
> var text = Console.ReadLine();
> 
> 
> 

and allow the user to later erase the text that got read. However, there is no clear way to do this. I know it can be done, since there are some text editors written in c#. Can someone point me in the right direction?

Answer: 
It all depends on how you want to delete the line.

You can check [Can Console.Clear be used to only clear a line instead of whole console?](https://stackoverflow.com/questions/8946808/can-console-clear-be-used-to-only-clear-a-line-instead-of-whole-console) that is basically replacing a specific line with the empty string:

[SetCursorPosition documentation](https://learn.microsoft.com/en-us/dotnet/api/system.console.setcursorposition?view=netcore-3.1)

```
// Parameters left, top
Console.SetCursorPosition(0, Console.CursorTop - 1);
Console.Write(new string(' ', Console.WindowWidth)); 
Console.SetCursorPosition(0, Console.CursorTop);

```

The question here, is how the user will interact with the console to let the console know which row to delete, as the line will change as new rows will be inserted, so you need to find a way to count lines after the first one was inserted.

So whenever you `Writeline` or `Readline` you need to increase the counter to maintain the history. If you want to do it for more than one line, then it gets even more complicated.
For starters, take a look into the methods available to the `Console` for the respective framework version you're using. It's possible to adjust the position of the cursor, which allows for plenty of fun.

<https://learn.microsoft.com/en-us/dotnet/api/system.console.setcursorposition?view=netcore-3.1>