How to read a string entered using the keyboard : Console Read : Development C# Examples


C# Examples » Development » Console Read »

 

How to read a string entered using the keyboard









    
class  MainClass
{

    public  static  void  Main()
    {

        System.Console.Write("Enter  a  string:  ");
        string  myString  =  System.Console.ReadLine();
        System.Console.WriteLine("You  entered  "  +  myString);

    }

}
    
   
  
   



Output

Enter a string: qwert
You entered qwert


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Development
» Console Read