Search code examples
c#console-applicationconsole.readline

How to change Cursor position in Console?


I wanted to use Console.ReadLine(); in the previous line and make it display like that:

HeresomeText>(input)

Not like

HeresomeText>
(input)

Is it possible to do?


Solution

  • use Write method instead of WriteLine Method:

     Console.Write("HeresomeText> ")
    

    in addition you can use SetCursorPosition:

    Console.SetCursorPosition(int left, int top);