Acidic
Acidic

Reputation: 6280

Console.ReadLine() without line break at the end?

Question is simple.

When I use -

Console.ReadLine()

The next thing printed on the console will on the next line.

Is there any way to continue printing on that line?

Thanks in advance.

Upvotes: 3

Views: 10243

Answers (3)

BLUEPIXY
BLUEPIXY

Reputation: 40145

use

Console.SetCursorPosition (x, y)

Upvotes: 2

Ankur
Ankur

Reputation: 33657

You can try:

    var s = Console.ReadLine();
    Console.CursorTop--;
    Console.CursorLeft = s.Length;
    Console.WriteLine("Hello");

Upvotes: 0

Muhammad Atif Agha
Muhammad Atif Agha

Reputation: 1545

Please check,

Console.Read();

This would not cause new line or line break.

Upvotes: 6

Related Questions