0

I am currently working on a game that takes place in the console. I need to know how to combine

Console.WriteLine()

and

Console.ReadLine()

into 1 line so that the blinking underscore appears on the same line. Is there any way to do this? Any help is appreciated.

6
Contributors
9
Replies
10
Views
6 Years
Discussion Span
Last Post by jmurph333
0

samuael, that worked perfectly however how would I still write text on that line?

0

I would like to write a string (s) to a line in the console. But instead of having the blinking underscore on the next line, I want it next to the string I just wrote to the console. In C++ it would be:

cout << s; cin.ignore();
1

WriteLine automatically adds a newline character. Write, on the other hand, does not.

Console.Write("");
Console.ReadLine();

Edited by Sodabread: n/a

0

Use Console Write or Read instead of WriteLine and ReadLine
The methods with Line add an extra cr char.

Edited by ddanbe: n/a

0

Thanks Sodabread, that was exactly what I was looking for. This is just another quick question. Is there anyway I can write some text on to the console, and then change that text to something else?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.