Reputation:
Can I do ReadLine in C# (I wanna read to string) without that invisible "\n" just before ReadLine?
I wanna this to look like that:
Type name:
$> (user types here)
But while using ReadLine, I get this:
Type name:
$>
(user types here).
How can I change cursor position to go back line?
Upvotes: 1
Views: 2708
Reputation: 3028
How are you writing the text to prompt the user? For this behavior you should be using Console.Write(), not .WriteLine() to leave the cursor at the end of the string written to the console.
See also this article explaining it further
Upvotes: 1