Reputation: 166
So I am wondering, how can I make a console start typing after a string? For example: The console says Username > and i can type after that instead of under.
Example:
How I have it now:
Username >
i type here
How I want it:
Username > i type here
I hope you guys know what I mean, thanks!
Upvotes: 1
Views: 475
Reputation: 6251
Output your prompt text before Console.Readline()
:
Console.Write("Username > ");
And the problem you are having is because you use Console.WriteLine()
which will append a new line after whatever you tell it to write. So use just Console.Write()
From MSDN:
Console.WriteLine() - Writes the specified data, followed by the current line terminator, to the standard output stream.
Console.Write() - Writes the text representation of the specified value or values to the standard output stream.
Upvotes: 3