c# - How to update console output text? -


i want user of console application update text written console.write(); example:

var currentvar="bla-bla-bla"; console.write(currentvar); var newvar=console.read();//here user can update previous output of write() method; console.write(newvar);//output of updated value 

is possible?

console.read doesn't read previous output, instead wait input.

console.read method - msdn

reads next character standard input stream.

the read method blocks return while type input characters; terminates when press enter key. pressing enter appends platform-dependent line termination sequence input (for example, windows appends carriage return-linefeed sequence). subsequent calls read method retrieve input 1 character @ time. after final character retrieved, read blocks return again , cycle repeats.

if intentd overwrite previous output new content, use console.setcursorposition. see this answer


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -