User Program Communication

User Input in C#

Used to read text from the user.


Syntax
string storeVariable = Console.ReadLine();

Notes

The ReadLine method, by default, stores the result in string format.


Example
Console.WriteLine("What is your full name?");
string name = Console.ReadLine();
Console.WriteLine("Your name is " + name); ///Output is 'Your name is (contents of name)'

See Also
Documentation

Console.ReadLine Method - MSDN

Add to Slack

< Commenting   |   Read from File >

© 2018 SyntaxDB. All Rights Reserved.