Last active
December 29, 2015 06:19
-
-
Save montyr75/7628003 to your computer and use it in GitHub Desktop.
Synchronously get a line of user input from the command line console (stdin). Using synchronous I/O in the console can greatly simplify your program.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "dart:io"; | |
void main() { | |
// get user input using synchronous I/O | |
String input = stdin.readLineSync(); | |
// get user input and convert to lowercase | |
String inputLC = stdin.readLineSync().toLowerCase(); | |
print(input); | |
print(inputLC); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment