c# Console app | Writeline with 2 colors? -


i learning c# , writing text based game.

i know if possible have 1 line of code (console.writeline method) outputs message game players given name different color kinda highlights it.

this current simple code message:

console.writeline("can survive, {0}?", player.getname(); //player.getname() returns name of user 

this asks user name:

        string name = null;         string input = null;         console.writeline("before can start journey, have enter name.");           while(input != "y")          {             if( input == null || input == "n" )             {                 console.writeline("please enter name , press enter:");                 name = console.readline();             }              console.writeline("your name {0}",name);             console.writeline("is correct? (y/n)");             input = console.readline();             input = input.toupper();         }   

i find 1 answer answer 2 years ago.. maybe changed?

thanks in advance if know answer.


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -