Mega Code Archive

 
Categories / C# Tutorial / Development
 

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);   } } Enter a string: qwert You entered qwert